Home > Back-end >  Eclipse CDT, Why does Eclipse prepends 'lib' to the name of a shared library?
Eclipse CDT, Why does Eclipse prepends 'lib' to the name of a shared library?

Time:12-10

I am using Eclipse Eclipse 2022-09 with CDT 10.7.1202208222120 on Fedora 37.

I am working on a simple C testapplication (libTest.cpp) which should use code from 2 shared librarys (libBasexCpp and libBasexSocket).
All 3 sources compile without errors and building libTest also completes without error. In the Properties -> Settings -> Build Artifact dialog for libBasexCpp and libBasexSocket, I have chosen not to use a Output Prefix (prefix is ""). In the debug directorys, libBasexCpp.so and libBasexSocket.so are created.
When I try to run the testapplication as a local C/C application, I first have to choose which local application should be run , liblibTest or libTest.
Executing either one of the 2 results in a message, saying that liblibBasexCpp can not be found.

I have added Library Paths (DYLD_LIBRARY_PATH = ${workspace_loc:/libBasexCpp/Debug};${workspace_loc:/libBasexSocket/Debug} as Environmentvariable to the run configuration.

How can I configure Eclipse in such way that it loads the shared library's?

CodePudding user response:

Basically, to configure the shared librarys and the test application, I followed the instructions as I found on Shared libraries with Eclipse CDT and cygwin on Windows. What was missing therein was the instruction to add in the Run configuration the variable LD_LIBRARY_PATH containing the paths to both libraries. After adding this variable, the test application worked.

  • Related