mcgoo / cargo-vcpkg

Get external dependencies in one step by specifying vcpkg details in Cargo.toml
Apache License 2.0
39 stars 6 forks source link

Building project throws wayland error #22

Open mario-hess opened 6 months ago

mario-hess commented 6 months ago

I installed cargo-vcpkg. This is my cargo.toml:

[package]
name = "gaemboi"
version = "0.1.0"
edition = "2021"

[dependencies]
rfd = "0.12.1"

[dependencies.sdl2]
version = "0.36"
features = ["ttf", "image", "static-link", "use-vcpkg"]

[package.metadata.vcpkg]
dependencies = ["sdl2", "sdl2-image[libjpeg-turbo,tiff,libwebp]", "sdl2-ttf"]
git = "https://github.com/microsoft/vcpkg"
rev = "4c1db68"

[package.metadata.vcpkg.target]
x86_64-pc-windows-msvc = { triplet = "x64-windows-static-md" }

Running 'cargo vcpkg build' works, but as soon as i run 'cargo build --release' it throws the following error:

error: linking with `cc` failed: exit status: 1
  |
  = note: LC_ALL="C" PATH="/home/mario/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin:/home/mario/.cargo/bin:/home/mario/go/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/usr/lib/rustup/bin" VSLANG="1033" "cc" "-m64" "/tmp/rustcnTHvBd/symbols.o" "/home/mario/dev/gaemboi/target/release/deps/gaemboi-1501b895c5478e5f.gaemboi.fc1af7893ee82b56-cgu.00.rcgu.o" "/home/mario/dev/gaemboi/target/release/deps/gaemboi-1501b895c5478e5f.gaemboi.fc1af7893ee82b56-cgu.01.rcgu.o" "/home/mario/dev/gaemboi/target/release/deps/gaemboi-1501b895c5478e5f.gaemboi.fc1af7893ee82b56-cgu.02.rcgu.o" "/home/mario/dev/gaemboi/target/release/deps/gaemboi-1501b895c5478e5f.gaemboi.fc1af7893ee82b56-cgu.03.rcgu.o" "/home/mario/dev/gaemboi/target/release/deps/gaemboi-1501b895c5478e5f.gaemboi.fc1af7893ee82b56-cgu.04.rcgu.o" "/home/mario/dev/gaemboi/target/release/deps/gaemboi-1501b895c5478e5f.gaemboi.fc1af7893ee82b56-cgu.05.rcgu.o" "/home/mario/dev/gaemboi/target/release/deps/gaemboi-1501b895c5478e5f.gaemboi.fc1af7893ee82b56-cgu.06.rcgu.o" "/home/mario/dev/gaemboi/target/release/deps/gaemboi-1501b895c5478e5f.gaemboi.fc1af7893ee82b56-cgu.07.rcgu.o" "/home/mario/dev/gaemboi/target/release/deps/gaemboi-1501b895c5478e5f.gaemboi.fc1af7893ee82b56-cgu.08.rcgu.o" "/home/mario/dev/gaemboi/target/release/deps/gaemboi-1501b895c5478e5f.gaemboi.fc1af7893ee82b56-cgu.09.rcgu.o" "/home/mario/dev/gaemboi/target/release/deps/gaemboi-1501b895c5478e5f.gaemboi.fc1af7893ee82b56-cgu.10.rcgu.o" "/home/mario/dev/gaemboi/target/release/deps/gaemboi-1501b895c5478e5f.gaemboi.fc1af7893ee82b56-cgu.11.rcgu.o" "/home/mario/dev/gaemboi/target/release/deps/gaemboi-1501b895c5478e5f.gaemboi.fc1af7893ee82b56-cgu.12.rcgu.o" "/home/mario/dev/gaemboi/target/release/deps/gaemboi-1501b895c5478e5f.gaemboi.fc1af7893ee82b56-cgu.13.rcgu.o" "/home/mario/dev/gaemboi/target/release/deps/gaemboi-1501b895c5478e5f.gaemboi.fc1af7893ee82b56-cgu.14.rcgu.o" "/home/mario/dev/gaemboi/target/release/deps/gaemboi-1501b895c5478e5f.gaemboi.fc1af7893ee82b56-cgu.15.rcgu.o" "/home/mario/dev/gaemboi/target/release/deps/gaemboi-1501b895c5478e5f.27a28h3vfvw1j1x0.rcgu.o" "-Wl,--as-needed" "-L" "/home/mario/dev/gaemboi/target/release/deps" "-L" "/home/mario/dev/gaemboi/target/vcpkg/installed/x64-linux/lib" "-L" "/home/mario/dev/gaemboi/target/vcpkg/installed/x64-linux/lib" "-L" "/home/mario/dev/gaemboi/target/vcpkg/installed/x64-linux/lib" "-L" "/home/mario/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/home/mario/dev/gaemboi/target/release/deps/librfd-f02bc66c9a770b83.rlib" "/home/mario/dev/gaemboi/target/release/deps/libraw_window_handle-3028e4602fd934de.rlib" "/home/mario/dev/gaemboi/target/release/deps/libgtk_sys-02aa8684d2667265.rlib" "/home/mario/dev/gaemboi/target/release/deps/libatk_sys-41254e2550f73ac1.rlib" "/home/mario/dev/gaemboi/target/release/deps/libgdk_sys-9040f9c10b2e1e4c.rlib" "/home/mario/dev/gaemboi/target/release/deps/libpango_sys-1a320de458f10beb.rlib" "/home/mario/dev/gaemboi/target/release/deps/libgdk_pixbuf_sys-6eb3f385e9781ecb.rlib" "/home/mario/dev/gaemboi/target/release/deps/libgio_sys-801e00efaf37b5d8.rlib" "/home/mario/dev/gaemboi/target/release/deps/libcairo_sys-50aeb5ef138b2def.rlib" "/home/mario/dev/gaemboi/target/release/deps/libgobject_sys-0838f6af5c96c900.rlib" "/home/mario/dev/gaemboi/target/release/deps/libglib_sys-71cf54c3d415f320.rlib" "/home/mario/dev/gaemboi/target/release/deps/libsdl2-de3e0ba41fc327de.rlib" "/home/mario/dev/gaemboi/target/release/deps/libsdl2_sys-d6ccf5c754be6b0c.rlib" "/home/mario/dev/gaemboi/target/release/deps/libbitflags-2b96ad076e85afe9.rlib" "/home/mario/dev/gaemboi/target/release/deps/liblazy_static-513c96079fce9e8f.rlib" "/home/mario/dev/gaemboi/target/release/deps/liblibc-9f5c59feffd9e6b7.rlib" "/home/mario/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-2d08990d644ac786.rlib" "/home/mario/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-6f2d4ec7ff80253d.rlib" "/home/mario/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-c194d68892442324.rlib" "/home/mario/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libmemchr-9a71c52c5946f83b.rlib" "/home/mario/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-ae9aec4ce2dabc4f.rlib" "/home/mario/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-6a207457d27610cc.rlib" "/home/mario/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-fb1d2514710eef16.rlib" "/home/mario/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-e36e7ed4b08caeac.rlib" "/home/mario/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-9e8dafdf0a1b7ecd.rlib" "/home/mario/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-b218f37fe3c9ce2e.rlib" "/home/mario/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-20c30954fd9b5ef4.rlib" "/home/mario/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler-6d3dfaf536d51163.rlib" "/home/mario/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-cb4ce50789112af8.rlib" "/home/mario/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-9897980a3b548e05.rlib" "/home/mario/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-b7bd4d010c784af2.rlib" "/home/mario/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-6d4515df28ba3369.rlib" "/home/mario/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-e28568c1a21499f7.rlib" "/home/mario/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-eedf3675950a13c2.rlib" "/home/mario/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-715e69127681e2e0.rlib" "-Wl,-Bdynamic" "-lgdk-3" "-lz" "-lharfbuzz" "-lpangocairo-1.0" "-lpango-1.0" "-latk-1.0" "-lcairo" "-lcairo-gobject" "-lgdk_pixbuf-2.0" "-lgio-2.0" "-lglib-2.0" "-lgobject-2.0" "-lgtk-3" "-lgobject-2.0" "-lglib-2.0" "-latk-1.0" "-lharfbuzz" "-lpangocairo-1.0" "-lpango-1.0" "-lgdk_pixbuf-2.0" "-lcairo-gobject" "-lcairo" "-lglib-2.0" "-lgobject-2.0" "-lgdk-3" "-lz" "-lgobject-2.0" "-lglib-2.0" "-lharfbuzz" "-lpango-1.0" "-lgobject-2.0" "-lglib-2.0" "-lgdk_pixbuf-2.0" "-lgobject-2.0" "-lglib-2.0" "-lgio-2.0" "-lcairo" "-lglib-2.0" "-lgobject-2.0" "-lglib-2.0" "-lgobject-2.0" "-lSDL2_image" "-lSDL2_ttf" "-lSDL2" "-lSDL2main" "-lfreetype" "-lpng" "-lpng16" "-lz" "-lbz2" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/home/mario/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/home/mario/dev/gaemboi/target/release/deps/gaemboi-1501b895c5478e5f" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-Wl,-O1" "-Wl,--strip-debug" "-nodefaultlibs"
  = note: /usr/bin/ld: /home/mario/dev/gaemboi/target/vcpkg/installed/x64-linux/lib/libSDL2.a(SDL_waylandvideo.c.o): undefined reference to symbol 'wl_proxy_marshal_flags'
          /usr/bin/ld: /usr/lib/libwayland-client.so.0: error adding symbols: DSO missing from command line
          collect2: error: ld returned 1 exit status

  = note: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
  = note: use the `-l` flag to specify native libraries to link
  = note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#rustc-link-lib)

I am using Arch Linux with X11. Does anyone know what to do? Thank you.