Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 12111

Linking error for SDL2 on linux while building with cargo

$
0
0

I am trying to build a project using cargo and this is the following error I get

  = note: /usr/bin/ld: /home/probot/dappicom/emulator/target/debug/deps/libsdl2-e3367154734f8b05.rlib(sdl2-e3367154734f8b05.sdl2.6bee403e1d2a37b8-cgu.07.rcgu.o): in function `sdl2::url::open_url':          /home/probot/.cargo/registry/src/index.crates.io-6f17d22bba15001f/sdl2-0.35.2/src/sdl2/url.rs:65: undefined reference to `SDL_OpenURL'          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#cargorustc-link-libkindname)error: could not compile `tetanes` (bin "tetanes") due to 1 previous error

I tried the solution given here same error but it did not work.

I changed the Library Path according to this solution error but on macOSand it did not work either.

EXPECTED:

successful cargo build.

What did i do

these are the commands I ran .

sudo apt-get updatesudo apt-get install libsdl2-mixer-dev libsdl2-image-dev libsdl2-ttf-dev libsdl2-gfx-devecho 'export LIBRARY_PATH="$LIBRARY_PATH/usr/local/lib"' \>\> \~/.bash_profilesource \~/.bash_profile

Viewing all articles
Browse latest Browse all 12111

Trending Articles