deltaphc / raylib-rs

Rust bindings for raylib
Other
793 stars 140 forks source link

`cross build --target x86_64-pc-windows-gnu --release` fails when linking #85

Open tazz4843 opened 3 years ago

tazz4843 commented 3 years ago

Used cross build --target x86_64-pc-windows-gnu to invoke the build, and it throws this error

error: linking with `x86_64-w64-mingw32-gcc` failed: exit code: 1
  |
  = note: "x86_64-w64-mingw32-gcc" "-fno-use-linker-plugin" "-Wl,--nxcompat" "-Wl,--dynamicbase" "-Wl,--disable-auto-image-base" "-m64" "-Wl,--high-entropy-va" "/rust/lib/rustlib/x86_64-pc-windows-gnu/lib/rsbegin.o" "-L" "/rust/lib/rustlib/x86_64-pc-windows-gnu/lib" "/target/x86_64-pc-windows-gnu/debug/deps/raylib_test-584c90bf7ca7ec64.10sqr6bj5bhxfxlm.rcgu.o" "/target/x86_64-pc-windows-gnu/debug/deps/raylib_test-584c90bf7ca7ec64.1ezps5wwt9k8xi6.rcgu.o" "/target/x86_64-pc-windows-gnu/debug/deps/raylib_test-584c90bf7ca7ec64.1sjt7s50y0ost0nx.rcgu.o" "/target/x86_64-pc-windows-gnu/debug/deps/raylib_test-584c90bf7ca7ec64.22oczvioxl82inuq.rcgu.o" "/target/x86_64-pc-windows-gnu/debug/deps/raylib_test-584c90bf7ca7ec64.237e6r189tiw6x93.rcgu.o" "/target/x86_64-pc-windows-gnu/debug/deps/raylib_test-584c90bf7ca7ec64.23lj72y9ri1bf155.rcgu.o" "/target/x86_64-pc-windows-gnu/debug/deps/raylib_test-584c90bf7ca7ec64.23wrf8kca9vyz1r4.rcgu.o" "/target/x86_64-pc-windows-gnu/debug/deps/raylib_test-584c90bf7ca7ec64.27h2xvh19esaksfr.rcgu.o" "/target/x86_64-pc-windows-gnu/debug/deps/raylib_test-584c90bf7ca7ec64.2erpkb0tux1ape7w.rcgu.o" "/target/x86_64-pc-windows-gnu/debug/deps/raylib_test-584c90bf7ca7ec64.2fw4hh8qrlne746b.rcgu.o" "/target/x86_64-pc-windows-gnu/debug/deps/raylib_test-584c90bf7ca7ec64.2h8c8pgb8vbgu5c0.rcgu.o" "/target/x86_64-pc-windows-gnu/debug/deps/raylib_test-584c90bf7ca7ec64.2ic7eexcj5f4ento.rcgu.o" "/target/x86_64-pc-windows-gnu/debug/deps/raylib_test-584c90bf7ca7ec64.2jfejn9lueish4o.rcgu.o" "/target/x86_64-pc-windows-gnu/debug/deps/raylib_test-584c90bf7ca7ec64.2jy7c6ydyyjdu3fw.rcgu.o" "/target/x86_64-pc-windows-gnu/debug/deps/raylib_test-584c90bf7ca7ec64.2k4avcrrwt8hf9k6.rcgu.o" "/target/x86_64-pc-windows-gnu/debug/deps/raylib_test-584c90bf7ca7ec64.2lorkkpu86i7d715.rcgu.o" "/target/x86_64-pc-windows-gnu/debug/deps/raylib_test-584c90bf7ca7ec64.2muhv40c4eg2fehg.rcgu.o" "/target/x86_64-pc-windows-gnu/debug/deps/raylib_test-584c90bf7ca7ec64.2phvw8cppg3zd6ev.rcgu.o" "/target/x86_64-pc-windows-gnu/debug/deps/raylib_test-584c90bf7ca7ec64.2q77kjgabxxo6bqi.rcgu.o" "/target/x86_64-pc-windows-gnu/debug/deps/raylib_test-584c90bf7ca7ec64.2ys6s6kgh14ljpj6.rcgu.o" "/target/x86_64-pc-windows-gnu/debug/deps/raylib_test-584c90bf7ca7ec64.36fm13n9r44wwfka.rcgu.o" "/target/x86_64-pc-windows-gnu/debug/deps/raylib_test-584c90bf7ca7ec64.3ormmm2yrplb0qo4.rcgu.o" "/target/x86_64-pc-windows-gnu/debug/deps/raylib_test-584c90bf7ca7ec64.3sgo2fya27r0spum.rcgu.o" "/target/x86_64-pc-windows-gnu/debug/deps/raylib_test-584c90bf7ca7ec64.3yzfb67zpor9sh2y.rcgu.o" "/target/x86_64-pc-windows-gnu/debug/deps/raylib_test-584c90bf7ca7ec64.4k7lm3p7vbqcpbsj.rcgu.o" "/target/x86_64-pc-windows-gnu/debug/deps/raylib_test-584c90bf7ca7ec64.4oshs2v7dbvmxmrp.rcgu.o" "/target/x86_64-pc-windows-gnu/debug/deps/raylib_test-584c90bf7ca7ec64.4y9642h3ryneakxg.rcgu.o" "/target/x86_64-pc-windows-gnu/debug/deps/raylib_test-584c90bf7ca7ec64.4yxz8j9gbedksntu.rcgu.o" "/target/x86_64-pc-windows-gnu/debug/deps/raylib_test-584c90bf7ca7ec64.516k00phh5ayquxn.rcgu.o" "/target/x86_64-pc-windows-gnu/debug/deps/raylib_test-584c90bf7ca7ec64.5and3hj3onik5vgt.rcgu.o" "/target/x86_64-pc-windows-gnu/debug/deps/raylib_test-584c90bf7ca7ec64.5c8yjbos5yxwttp0.rcgu.o" "/target/x86_64-pc-windows-gnu/debug/deps/raylib_test-584c90bf7ca7ec64.5fawvr9374eb0m2v.rcgu.o" "/target/x86_64-pc-windows-gnu/debug/deps/raylib_test-584c90bf7ca7ec64.hjm9vwlkapfw4c7.rcgu.o" "/target/x86_64-pc-windows-gnu/debug/deps/raylib_test-584c90bf7ca7ec64.up7fd0flf8ozi0e.rcgu.o" "/target/x86_64-pc-windows-gnu/debug/deps/raylib_test-584c90bf7ca7ec64.y5l42qyenmmu2t.rcgu.o" "-o" "/target/x86_64-pc-windows-gnu/debug/deps/raylib_test-584c90bf7ca7ec64.exe" "/target/x86_64-pc-windows-gnu/debug/deps/raylib_test-584c90bf7ca7ec64.17ajpfgviovh6hds.rcgu.o" "-Wl,--gc-sections" "-nodefaultlibs" "-L" "/target/x86_64-pc-windows-gnu/debug/deps" "-L" "/target/debug/deps" "-L" "/target/x86_64-pc-windows-gnu/debug/build/raylib-sys-38583f9fa58e6f88/out/lib" "-L" "/usr/local/lib" "-L" "/target/x86_64-pc-windows-gnu/debug/build/raylib-sys-38583f9fa58e6f88/out" "-L" "/rust/lib/rustlib/x86_64-pc-windows-gnu/lib" "-Wl,-Bstatic" "/target/x86_64-pc-windows-gnu/debug/deps/libraylib-5ab16a32c776c6ce.rlib" "/target/x86_64-pc-windows-gnu/debug/deps/liblibc-dfc5fee2ca30d918.rlib" "/target/x86_64-pc-windows-gnu/debug/deps/libraylib_sys-7dc04b0e597ddb62.rlib" "-Wl,--start-group" "/rust/lib/rustlib/x86_64-pc-windows-gnu/lib/libstd-94f60f405c1748af.rlib" "/rust/lib/rustlib/x86_64-pc-windows-gnu/lib/libpanic_unwind-f56d3aec7c2576d9.rlib" "/rust/lib/rustlib/x86_64-pc-windows-gnu/lib/libobject-8e553c585536bfaf.rlib" "/rust/lib/rustlib/x86_64-pc-windows-gnu/lib/libaddr2line-3a82c272c5de0489.rlib" "/rust/lib/rustlib/x86_64-pc-windows-gnu/lib/libgimli-ef04c21117777245.rlib" "/rust/lib/rustlib/x86_64-pc-windows-gnu/lib/librustc_demangle-b3ae962defb8b363.rlib" "/rust/lib/rustlib/x86_64-pc-windows-gnu/lib/libhashbrown-b441247297fa184b.rlib" "/rust/lib/rustlib/x86_64-pc-windows-gnu/lib/librustc_std_workspace_alloc-19bb25a86d3a5b92.rlib" "/rust/lib/rustlib/x86_64-pc-windows-gnu/lib/libunwind-d7957714cc30050c.rlib" "/rust/lib/rustlib/x86_64-pc-windows-gnu/lib/libcfg_if-abd7bd18212580be.rlib" "/rust/lib/rustlib/x86_64-pc-windows-gnu/lib/liblibc-80187982c9cf70bf.rlib" "/rust/lib/rustlib/x86_64-pc-windows-gnu/lib/liballoc-4172a25dd8c4f2de.rlib" "/rust/lib/rustlib/x86_64-pc-windows-gnu/lib/librustc_std_workspace_core-27282989cc5b80d2.rlib" "/rust/lib/rustlib/x86_64-pc-windows-gnu/lib/libcore-2f52c7ac303d5565.rlib" "-Wl,--end-group" "/rust/lib/rustlib/x86_64-pc-windows-gnu/lib/libcompiler_builtins-2b00c29940bf9d8a.rlib" "-Wl,-Bdynamic" "-lX11" "-ladvapi32" "-lws2_32" "-luserenv" "-lgcc_eh" "-l:libpthread.a" "-lmsvcrt" "-lmingwex" "-lmingw32" "-lgcc" "-lmsvcrt" "-luser32" "-lkernel32" "/rust/lib/rustlib/x86_64-pc-windows-gnu/lib/rsend.o"
  = note: /usr/bin/x86_64-w64-mingw32-ld: cannot find -lX11
          collect2: error: ld returned 1 exit status

Using version 3.5.0, getting the same issue as in #66 but it doesn't seem to be fixed for me.

tazz4843 commented 3 years ago

Adding raylib as a git dependency

[dependencies.raylib]
git = "https://github.com/Ewpratten/raylib-rs"
branch = "windows_xcompile"

works fine, but adding it as a normal dependency

[dependencies]
raylib = "3.5.0"

fails with the above error.

ewpratten commented 3 years ago

I'm not sure how you ended up on my fork, and not upstream..

Anyways, please don't use my git url or branch (ewpratten/raylib-rs). Those are designed to support two Ludum Dare games that require some hacks to make everything work.

Use this instead:

[dependencies]
raylib = { version = "3.5", git = "https://github.com/deltaphc/raylib-rs" }
ewpratten commented 3 years ago

@deltaphc you probably want to close this