epelc
epelc

Reputation: 5734

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.

Upvotes: 3

Views: 12799

Answers (2)

feng
feng

Reputation: 127

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.

Upvotes: 3

samarone
samarone

Reputation: 332

I had the some problem, the solution:

Insert a variable environment DYLD_LIBRARY_PATH = ${workspace_loc:/sharedlib/Debug} into run configuration.

Upvotes: 2

Related Questions