User forums > Using Code::Blocks

Error while loading shared library

<< < (2/3) > >>

mihasic:
Even worse, I created two model dummy libraries, static and shared, and I experience the same problem with both of them. The test project does not see any of them.

Miguel Gimenez:
See the man page for ldconfig and assure your .so files are in the cache.

gd_on:
did you add in your LD_LIBRARY_PATH the path of your .so lib ? This is used by linux at execution time.
If you set the path in code::blocks, it is correctly found at compile and link time. It's why here it's OK.
But when you execute your soft (standalone and even within C::B), linux has not this config in mind.
More, when you build as static, I suppose that you have used a .a file, but it's not always a static lib.

mihasic:

--- Quote from: gd_on on December 01, 2022, 10:08:02 am ---did you add in your LD_LIBRARY_PATH the path of your .so lib ? This is used by linux at execution time.
If you set the path in code::blocks, it is correctly found at compile and link time. It's why here it's OK.
But when you execute your soft (standalone and even within C::B), linux has not this config in mind.
More, when you build as static, I suppose that you have used a .a file, but it's not always a static lib.

--- End quote ---

What is LD_LIBRARY_PATH and where should I add it? I see no such option in CodeBlocks. As I have stated, I added all the .so files with their actual full paths to Settings->Compiler->Linker settings->Link libraries. Besides, I added the directory they are placed in, to Settings->Compiler->Search directories->linker.

mihasic:

--- Quote from: Miguel Gimenez on December 01, 2022, 08:58:26 am ---See the man page for ldconfig and assure your .so files are in the cache.

--- End quote ---
I beg your pardon, I don't understand a word here. I am a 'windows refugee' and rather new to linux.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version