Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing to link with shared raylib #189

Open
rakivo opened this issue May 10, 2024 · 0 comments
Open

Failing to link with shared raylib #189

rakivo opened this issue May 10, 2024 · 0 comments

Comments

@rakivo
Copy link

rakivo commented May 10, 2024

I've followed nobuild guide but anyway keep facing this error:

error: linking with `cc` failed: exit status: 1
  |
  = note: LC_ALL="C" PATH="/home/yarson/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin:/home/yarson/.cargo/bin:/usr/condabin:/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:/opt/rocm/bin:/usr/lib/rustup/bin" VSLANG="1033" "cc" "-m64" "/tmp/rustcv68FIE/symbols.o" "/home/yarson/Coding/probe/raylib_rust/target/release/deps/raylib_rust-4d232eb3bbaff2ef.raylib_rust.311e897e0720339c-cgu.0.rcgu.o" "-Wl,--as-needed" "-L" "/home/yarson/Coding/probe/raylib_rust/target/release/deps" "-L" "./build/" "-L" "/home/yarson/Coding/probe/raylib_rust/target/release/build/raylib-sys-3c90d6748415b075/out" "-L" "/home/yarson/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bdynamic" "-lraylib" "-L" "/home/yarson/Coding/probe/raylib_rust/target/release/deps" "-lplug" "-Wl,-Bstatic" "/home/yarson/Coding/probe/raylib_rust/target/release/deps/liblibloading-0d7a5d82a9890c35.rlib" "-L" "/home/yarson/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bdynamic" "-lstd-2d08990d644ac786" "-Wl,-Bstatic" "/home/yarson/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-715e69127681e2e0.rlib" "-Wl,-Bdynamic" "-ldl" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/home/yarson/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/home/yarson/Coding/probe/raylib_rust/target/release/deps/raylib_rust-4d232eb3bbaff2ef" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-Wl,-O1" "-Wl,--strip-debug" "-nodefaultlibs"
  = note: /usr/bin/ld: /home/yarson/Coding/probe/raylib_rust/target/release/deps/libplug.so: undefined reference to `GetDroppedFiles'
          /usr/bin/ld: /home/yarson/Coding/probe/raylib_rust/target/release/deps/libplug.so: undefined reference to `GetScreenData'
          /usr/bin/ld: /home/yarson/Coding/probe/raylib_rust/target/release/deps/libplug.so: undefined reference to `CloseAudioStream'
          /usr/bin/ld: /home/yarson/Coding/probe/raylib_rust/target/release/deps/libplug.so: undefined reference to `StopSoundMulti'
          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)

my build.rs:

fn main() {
    println!("cargo:rustc-link-search=./build/");
    println!("cargo:rustc-link-lib=raylib");
}

I've tried raylib 3.5, raylib 3.0, not working.

My rustc version: rustc 1.77.2 (25ef9e3d8 2024-04-09).

It's strange though, linkage failed only with this 4 functions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant