User forums > Using Code::Blocks

[SOLVED]"Cannot open shared object file ..." when running executable from C::B

<< < (2/4) > >>

oBFusCATed:
Can you post a full rebuild log?

ejamsa:
Sure,

--- Code: ----------------- Clean: Debug in test (compiler: GNU GCC Compiler)---------------

Cleaned "test - Debug"

-------------- Build: Debug in test (compiler: GNU GCC Compiler)---------------

g++ -Wall -g -std=c++11 -I/home/ejamsa/SFML-2.1/include -c /home/ejamsa/Projects/sfml/test/main.cpp -o obj/Debug/main.o
g++ -L/home/ejamsa/SFML-2.1/lib -o bin/Debug/test obj/Debug/main.o  -lsfml-system -lsfml-window -lsfml-graphics  ../../../SFML-2.1/lib/libsfml-system.so
Output file is bin/Debug/test with size 100.08 KB
--- End code ---

Strange is that it complains about libsfml-system.so.2 (which is a symlink) not about libsfml-system.so (which is also symlink). The real library is libsfml-system.so.2.1!

oBFusCATed:
The linking command looks strange.
Could it be that you've overridden your libsfml-system.so by setting your project's output file to point there?

ejamsa:
Sorry, the correct output is

--- Code: ----------------- Clean: Debug in test (compiler: GNU GCC Compiler)---------------

Cleaned "test - Debug"

-------------- Build: Debug in test (compiler: GNU GCC Compiler)---------------

g++ -Wall -g -std=c++11 -I/home/eero/SFML-2.1/include -c /home/eero/Projects/sfml/test/main.cpp -o obj/Debug/main.o
g++ -L/home/eero/SFML-2.1/lib -o bin/Debug/test obj/Debug/main.o  -lsfml-system -lsfml-window -lsfml-graphics  
Output file is bin/Debug/test with size 100.08 KB
Process terminated with status 0 (0 minute(s), 1 second(s))
0 error(s), 0 warning(s) (0 minute(s), 1 second(s))
--- End code ---

The

--- Code: ---../../../SFML-2.1/lib/libsfml-system.so
--- End code ---
from the previous post was my "hack" where I tried to add libsfml-system.so by selecting it in Settings->Compiler...->Linker settings->Link libraries:!

oBFusCATed:
Strange... C::B should have added "/home/ejamsa/SFML-2.1/lib"  to the LD_LIBRARY_PATH but it has not.
Can you try if C::B modifies the LD_LIBRARY_PATH with a simple console project?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version