Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse CDT Linking to shared Library

I have two projects in eclipse CDT on my Mac. One is a shared library the other is a C++ project that uses the shared library. I am trying to use the shared library, and have gotten it to compile but it will not run. When i try to run it i get a image not found error.

I haven't been able to figure out how to add my library to the path directory or ld_library_path or what every other path I need to add it to so that it can be linked to at run time. I already added it as a reference in my other project which has correctly setup run time linking for me but i need help setting up run time linking.

like image 315
epelc Avatar asked Mar 07 '26 01:03

epelc


1 Answers

When I try to run a program which uses another shared-link library, also I want to run the program inside the eclipse. Here is what I did:

Insert a variable environment LD_LIBRARY_PATH="where you shared lib file is" in "Run/Debug Settings" and problem solved.

like image 120
feng Avatar answered Mar 09 '26 14:03

feng



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!