Skip to content

Linker error when creating empty window: cannot find -lasound #2

Description

@pumpkinstein

When running on Pop!_OS 22.04 LTS the initial build fails:

error: linking with `cc` failed: exit status: 1
  |
  = note:  "cc" "-m64" "/tmp/rustcimQ8fc/symbols.o" "<12 object files omitted>" "-Wl,--as-needed" "-Wl,-Bstatic" "/media/moxx/D0-P1/code/rust/makepad_image_viewer/target/release/deps/{libmakepad_widgets-03db2e09d25d6fe9.rlib,libmakepad_fonts_chinese_bold_2-0565488aeb833ee1.rlib,libmakepad_fonts_chinese_bold-3d6f873aee119e20.rlib,libmakepad_fonts_chinese_regular_2-ea24431994488b20.rlib,libmakepad_fonts_chinese_regular-bf2d4e7df8011f09.rlib,libmakepad_fonts_emoji-3c3bd459a5f63231.rlib,libpulldown_cmark-94d01156adf9eb97.rlib,libmemchr-4a4193a14c8c4c59.rlib,libunicase-22c9675f0a6e5c18.rlib,libmakepad_zune_png-b3a2db90f91f86c5.rlib,libzune_inflate-5829d7c121a768f6.rlib,libzune_core-3c70c357df6ffbde.rlib,libmakepad_zune_jpeg-258032731a710c51.rlib,libmakepad_zune_core-62c9a24e4a5538e2.rlib,libmakepad_draw-84c3567bc4fd6082.rlib,libttf_parser-4b4e11988f759812.rlib,libsdfer-01f660f18456283a.rlib,libunicode_segmentation-68e1bbc9c8de8c9c.rlib,libab_glyph_rasterizer-d8708bbd10943338.rlib,libmakepad_html-8781cf003970535e.rlib,libmakepad_rustybuzz-adeeb9fe659bf154.rlib,libunicode_bidi_mirroring-527b83c246d8b297.rlib,libunicode_script-e7ddb6bd3ef4fbc6.rlib,libunicode_ccc-3d0423b5d6401e5f.rlib,libunicode_properties-ddafaf6a8b2677ae.rlib,libmakepad_vector-edb7cfa698b990ca.rlib,libmakepad_ttf_parser-1932fa99a5817da9.rlib,libresvg-6487dde4fd37f008.rlib,librgb-60f2062d500b77ed.rlib,libusvg-bbeee3c221b0864f.rlib,libbase64-fd0db66a7e52a3b8.rlib,libimagesize-20e16a35c0db077f.rlib,libdata_url-00982df0a60d1978.rlib,libxmlwriter-97cb10828c1cbd9c.rlib,libsimplecss-e75ebf755d03e4dd.rlib,libroxmltree-7eed882d2f91ea6f.rlib,libsvgtypes-593362e230c7f949.rlib,libkurbo-19cd77cc82d11df0.rlib,libsiphasher-f809ddc17dd2c31a.rlib,libtiny_skia-ecea9a263987efef.rlib,libpng-e5ce76942ce83733.rlib,libbitflags-9bf06a23e6cf3105.rlib,libflate2-1f4860a460ea7ad9.rlib,libminiz_oxide-089c9e5d07259004.rlib,libfdeflate-b8c9437076ba8e21.rlib,libsimd_adler32-2083aa991b946fda.rlib,libcrc32fast-b19641995b496e53.rlib,libcfg_if-a77335275c189643.rlib,liblog-703bbd15fb8a72d1.rlib,libarrayvec-a87079a7c85323ae.rlib,libtiny_skia_path-ffd485844091ddd5.rlib,libbytemuck-6d8eb93354b9a27c.rlib,libstrict_num-3774fb138cbabeed.rlib,libfloat_cmp-fdede1d5fa8771dc.rlib,libarrayref-c5fa6fdeb8d658fc.rlib,libmakepad_platform-fd1feb057fd37dd7.rlib,libbitflags-42a982cdd86af937.rlib,libmakepad_shader_compiler-6a549e30b2f9288a.rlib,libmakepad_live_compiler-764fd7143199c713.rlib,libmakepad_live_tokenizer-ab119cb372a658a8.rlib,libmakepad_math-bb016605f510e54a.rlib,libmakepad_micro_serde-7351f2e2193c5706.rlib,libmakepad_live_id-640894a5d2a3949d.rlib,libsmallvec-e370611f1d358482.rlib,libmakepad_futures-cef5c64e51add28d.rlib,libmakepad_http-678cc941245c4a8a.rlib}.rlib" "<sysroot>/lib/rustlib/x86_64-unknown-linux-gnu/lib/{libstd-*,libpanic_unwind-*,libobject-*,libmemchr-*,libaddr2line-*,libgimli-*,librustc_demangle-*,libstd_detect-*,libhashbrown-*,librustc_std_workspace_alloc-*,libminiz_oxide-*,libadler2-*,libunwind-*,libcfg_if-*,liblibc-*,liballoc-*,librustc_std_workspace_core-*,libcore-*,libcompiler_builtins-*}.rlib" "-Wl,-Bdynamic" "-lXcursor" "-lX11" "-lasound" "-lpulse" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-L" "/tmp/rustcimQ8fc/raw-dylibs" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "<sysroot>/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/media/moxx/D0-P1/code/rust/makepad_image_viewer/target/release/deps/makepad_image_viewer-b8da1ba52b8c8291" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-Wl,-O1" "-Wl,--strip-debug" "-nodefaultlibs"
  = note: some arguments are omitted. use `--verbose` to show all linker arguments
  = note: /usr/bin/ld: cannot find -lasound: No such file or directory
          collect2: error: ld returned 1 exit status
          

error: could not compile `makepad_image_viewer` (bin "makepad_image_viewer") due to 1 previous error

In addition to the libraries you listed in the introduction chapter this was fixed by installing libasound2-dev as well

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions