Comments (14)
So the linker can't find the SDL2 library. Before trying anything else, could you run sudo ldconfig
and try compiling again afterwards, please?
If that still doesn't work, then either sdl2 is not called libSDL2.so on your system, or it's placed somewhere not in the linker's search path. I'm on my phone now, so I can't easily check
from rust-doom.
Thank you for this quick comment.
I've already launch ldconfig
, and the SDL2 lib is already linked:
ldconfig -p | grep SDL
libSDL2-2.0.so.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0
libSDL2-2.0.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so
libSDL_image-1.2.so.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libSDL_image-1.2.so.0
libSDL-1.2.so.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0
So, i think I have to modify the linker's search path to search in /usr/lib/x86_64_linux-gnu/ to find this library, right?
He can't find this library because he goes to a specific directory for 32 bits libraries?
from rust-doom.
Do you have a /usr/lib/x86_64-linux-gnu/libSDL2.so
symbolic link on your system? If not, could you try creating it? i.e.
sudo ln -s /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so /usr/lib/x86_64-linux-gnu/libSDL2.so
This is what I've got (on Ubuntu):
$ ls -l /usr/lib/x86_64-linux-gnu/libSDL2.so
lrwxrwxrwx 1 root root 20 May 15 2014 /usr/lib/x86_64-linux-gnu/libSDL2.so -> libSDL2-2.0.so.0.2.0
from rust-doom.
Unfortunately yes:
ls -l /usr/lib/x86_64-linux-gnu/libSDL2.so
lrwxrwxrwx 1 root root 20 mai 15 2014 /usr/lib/x86_64-linux-gnu/libSDL2.so -> libSDL2-2.0.so.0.2.0
The command canno't be executed also:
sudo ln -s /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so /usr/lib/x86_64-linux-gnu/libSDL2.so
ln: failed to create symbolic link ‘/usr/lib/x86_64-linux-gnu/libSDL2.so’: File exists
I have already try to remove the library and to purge dependencies before install those again but no results... :-/
from rust-doom.
Hmm, not giving up yet! What do you have in your LIBRARY_PATH
and LD_LIBRARY_PATH
environment variables? In particular do they contain /usr/lib/x86_64-linux-gnu
?
from rust-doom.
No, that's true!
But after the modification, the error still the same...
echo $LIBRARY_PATH
/usr/lib/x86_64-linux-gnu
echo $LD_LIBRARY_PATH
/usr/lib/x86_64-linux-gnu
This is the complete error of the build:
Compiling rs_doom v0.0.7 (file:///home/k0pernicus/Documents/rust-doom)
error: linking with `cc` failed: exit code: 1
note: "cc" "-Wl,--as-needed" "-m32" "-L" "/usr/local/lib/rustlib/i686-unknown-linux-gnu/lib" "/home/k0pernicus/Documents/rust-doom/target/release/rs_doom.0.o" "-o" "/home/k0pernicus/Documents/rust-doom/target/release/rs_doom" "-Wl,--gc-sections" "-pie" "-Wl,-O1" "-nodefaultlibs" "-L" "/home/k0pernicus/Documents/rust-doom/target/release" "-L" "/home/k0pernicus/Documents/rust-doom/target/release/deps" "-L" "/home/k0pernicus/Documents/rust-doom/target/release/build/miniz-sys-d19b88f9ef21a81d/out" "-L" "/usr/local/lib/rustlib/i686-unknown-linux-gnu/lib" "-L" "/home/k0pernicus/Documents/rust-doom/.rust/lib/i686-unknown-linux-gnu" "-L" "/home/k0pernicus/Documents/rust-doom/lib/i686-unknown-linux-gnu" "-Wl,-Bstatic" "-Wl,-Bdynamic" "/home/k0pernicus/Documents/rust-doom/target/release/deps/libgame-8cfee425b6ee9879.rlib" "/home/k0pernicus/Documents/rust-doom/target/release/deps/libenv_logger-bbd82f3547b4db71.rlib" "/home/k0pernicus/Documents/rust-doom/target/release/deps/libgetopts-bd82d57ca5684ae5.rlib" "/home/k0pernicus/Documents/rust-doom/target/release/deps/libwad-cd615ceff76ea334.rlib" "/home/k0pernicus/Documents/rust-doom/target/release/deps/libtime-5546927e45303414.rlib" "/home/k0pernicus/Documents/rust-doom/target/release/deps/libgfx-6bebdf3762ca88b8.rlib" "/home/k0pernicus/Documents/rust-doom/target/release/deps/liblog-6e27e2da5513596d.rlib" "/home/k0pernicus/Documents/rust-doom/target/release/deps/libmath-7b32f5d43a780379.rlib" "/home/k0pernicus/Documents/rust-doom/target/release/deps/libtoml-f9d4bcccaf6c49db.rlib" "/home/k0pernicus/Documents/rust-doom/target/release/deps/libglium_sdl2-55be2a6928c25ef0.rlib" "/home/k0pernicus/Documents/rust-doom/target/release/deps/libregex-44ebda3c16a8018d.rlib" "/home/k0pernicus/Documents/rust-doom/target/release/deps/libaho_corasick-d05abe6e803a25f9.rlib" "/home/k0pernicus/Documents/rust-doom/target/release/deps/libmemchr-c271e615ca8016c2.rlib" "/home/k0pernicus/Documents/rust-doom/target/release/deps/libglium-21928d8511e45830.rlib" "/home/k0pernicus/Documents/rust-doom/target/release/deps/libnalgebra-eec5da6a2d5e5f5b.rlib" "/home/k0pernicus/Documents/rust-doom/target/release/deps/libglutin-bf76ed33700ba108.rlib" "/home/k0pernicus/Documents/rust-doom/target/release/deps/libwayland_kbd-de9a367fb8f54e36.rlib" "/home/k0pernicus/Documents/rust-doom/target/release/deps/libosmesa_sys-bcfb4e9f5ccba110.rlib" "/home/k0pernicus/Documents/rust-doom/target/release/deps/libcgmath-fee5293301deaa40.rlib" "/home/k0pernicus/Documents/rust-doom/target/release/deps/libmmap-3228d1a911ccf2d6.rlib" "/home/k0pernicus/Documents/rust-doom/target/release/deps/libgl_common-a5d890954f8be2d6.rlib" "/home/k0pernicus/Documents/rust-doom/target/release/deps/libimage-6bcbcef3c1f7139e.rlib" "/home/k0pernicus/Documents/rust-doom/target/release/deps/libgif-caf31349e2797a43.rlib" "/home/k0pernicus/Documents/rust-doom/target/release/deps/libcolor_quant-c8840af87a039b7f.rlib" "/home/k0pernicus/Documents/rust-doom/target/release/deps/libpng-b46bdcdffbade93e.rlib" "/home/k0pernicus/Documents/rust-doom/target/release/deps/liblzw-b06eded40745f4f3.rlib" "/home/k0pernicus/Documents/rust-doom/target/release/deps/libwayland_window-a0302ed36290a7bb.rlib" "/home/k0pernicus/Documents/rust-doom/target/release/deps/libtempfile-10bff676904f21f2.rlib" "/home/k0pernicus/Documents/rust-doom/target/release/deps/libbyteorder-a9d27879d7f2c887.rlib" "/home/k0pernicus/Documents/rust-doom/target/release/deps/libenum_primitive-b5b95bcd4494e441.rlib" "/home/k0pernicus/Documents/rust-doom/target/release/deps/libsmallvec-8e27dc6b52754509.rlib" "/home/k0pernicus/Documents/rust-doom/target/release/deps/libflate2-78d4363886f4b66b.rlib" "/home/k0pernicus/Documents/rust-doom/target/release/deps/libminiz_sys-d19b88f9ef21a81d.rlib" "/home/k0pernicus/Documents/rust-doom/target/release/deps/libx11_dl-83a05ff1ef61de57.rlib" "/home/k0pernicus/Documents/rust-doom/target/release/deps/libdylib-daffd2693659ccef.rlib" "/home/k0pernicus/Documents/rust-doom/target/release/deps/libbacktrace-e4c0ebe143c52b5d.rlib" "/home/k0pernicus/Documents/rust-doom/target/release/deps/libdbghelp-040983399761f987.rlib" "/home/k0pernicus/Documents/rust-doom/target/release/deps/libkernel32-c606ce60307b6481.rlib" "/home/k0pernicus/Documents/rust-doom/target/release/deps/libdebug_builders-4717471a4c16d259.rlib" "/home/k0pernicus/Documents/rust-doom/target/release/deps/libbacktrace_sys-e659868d1ba4bec9.rlib" "/home/k0pernicus/Documents/rust-doom/target/release/deps/libwinapi-3afcd2170e6034e1.rlib" "/home/k0pernicus/Documents/rust-doom/target/release/deps/libbitflags-83dc6fc5ecc9dd71.rlib" "/home/k0pernicus/Documents/rust-doom/target/release/deps/libsdl2-21b95ebba2160a5f.rlib" "/home/k0pernicus/Documents/rust-doom/target/release/deps/libsdl2_sys-b5d0e29d4b0af36c.rlib" "/home/k0pernicus/Documents/rust-doom/target/release/deps/libnum-2ece09fbdcaec573.rlib" "/home/k0pernicus/Documents/rust-doom/target/release/deps/librustc_serialize-e13845f83f5be3dc.rlib" "/home/k0pernicus/Documents/rust-doom/target/release/deps/libcommon-bea1f988784460d3.rlib" "/home/k0pernicus/Documents/rust-doom/target/release/deps/librand-a5a71c849766362c.rlib" "/home/k0pernicus/Documents/rust-doom/target/release/deps/libshared_library-df6a4ed1de1c004a.rlib" "/home/k0pernicus/Documents/rust-doom/target/release/deps/libwayland_client-92ee4c95af297731.rlib" "/home/k0pernicus/Documents/rust-doom/target/release/deps/libdlib-464d32cdfc50ec82.rlib" "/home/k0pernicus/Documents/rust-doom/target/release/deps/liblazy_static-512518894775e8b8.rlib" "/home/k0pernicus/Documents/rust-doom/target/release/deps/liblibc-165b5479aec0459c.rlib" "/home/k0pernicus/Documents/rust-doom/target/release/deps/libbitflags-d8aad5e08369cb92.rlib" "/home/k0pernicus/Documents/rust-doom/target/release/deps/libregex_syntax-3bd7600d419463d3.rlib" "/home/k0pernicus/Documents/rust-doom/target/release/deps/libcfg_if-f8ac1d2a9eed8e25.rlib" "/usr/local/lib/rustlib/i686-unknown-linux-gnu/lib/libstd-10cbabc2.rlib" "/usr/local/lib/rustlib/i686-unknown-linux-gnu/lib/libcollections-10cbabc2.rlib" "/usr/local/lib/rustlib/i686-unknown-linux-gnu/lib/librustc_unicode-10cbabc2.rlib" "/usr/local/lib/rustlib/i686-unknown-linux-gnu/lib/librand-10cbabc2.rlib" "/usr/local/lib/rustlib/i686-unknown-linux-gnu/lib/liballoc-10cbabc2.rlib" "/usr/local/lib/rustlib/i686-unknown-linux-gnu/lib/liballoc_jemalloc-10cbabc2.rlib" "/usr/local/lib/rustlib/i686-unknown-linux-gnu/lib/liblibc-10cbabc2.rlib" "/usr/local/lib/rustlib/i686-unknown-linux-gnu/lib/libcore-10cbabc2.rlib" "-l" "rt" "-l" "SDL2" "-l" "SDL2" "-l" "c" "-l" "m" "-l" "dl" "-l" "pthread" "-l" "gcc_s" "-l" "rt" "-l" "pthread" "-l" "c" "-l" "m" "-l" "compiler-rt"
note: /usr/bin/ld: cannot find -lSDL2
/usr/bin/ld: cannot find -lSDL2
collect2: error: ld returned 1 exit status
error: aborting due to previous error
Could not compile `rs_doom`.
I try to install the 32 bits of SDL2 library (because the linker try to link with some i386 libs I think), but if this library and dependances are installed, the system erase my 64 bits configuration... This is really annoying :(
from rust-doom.
It's true that there's the "m32" flag and the i686 paths in there that are a bit worrying; I don't really know why it's trying to link as 32 bits :(. I think this might be to do with the rust sdl2 library misidentifying your system as 32 bits.
from rust-doom.
I think so...
I'll create an issue in rust-sdl2, and, if I have any solution for this problem, I'll note that one bellow.
Thanks a lot for your patience :-)
from rust-doom.
What do you get if you run pkg-config sdl2 --libs
? If you don't have pkg-config
could you try installing it, then doing cargo clean && cargo build
? I think SDL2 is trying to use it.
from rust-doom.
This is the result of the command:
$pkg-config sdl2 --libs
-Wl,-rpath,/usr/local/lib -L/usr/local/lib -lSDL2 -lpthread
from rust-doom.
Interesting.... As one last attempt, could you try creating a symbolic link of SDL2 in /usr/local/lib ?
sudo ln -s /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so /usr/local/lib
from rust-doom.
Still the same error - nothing have changed :-/
from rust-doom.
I'm sorry this is not working out for you. I think you're right though; the problem is probably the 32 bit issue.
from rust-doom.
It's ok now - the script installer of Rust doesn't install a 64 bits Rust compiler on a 64 bits OS...
So, I've already download and install a 64 bits Rust compiler and all works fine now :-)
Thanks for all!!!
from rust-doom.
Related Issues (20)
- How easy would it be to turn this into a proper DooM source port? HOT 2
- clippy warnings (more) HOT 2
- Use of unstable library feature 'ord_max_min' HOT 2
- Cannot move (mouse on mac) HOT 4
- Illegal hardware instruction HOT 2
- Mark `Id` as thread-safe HOT 1
- Keyboard input does not work on Mac
- Dependency Does Not Compile HOT 1
- Can't start doom HOT 3
- Signed distance of Line2 HOT 4
- SIGABRT when using Wayland
- Should font be local?
- Typo in Cargo.toml HOT 1
- Rare jumpy view rotation with left-right keyboard HOT 2
- Build fails on OS X 10.11.4 HOT 2
- Unreachable code branch HOT 3
- [meta] clippy warnings HOT 3
- Feature: "screenshot map" command HOT 1
- Cargo: Compilation warnings
- Game Crash when hitting any key HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rust-doom.