Reputation: 507
I'm trying to install a package (pyfacetracker in case anyone is curious) and am having trouble getting it to find the opencv libraries when I run setup.py build.
ld: library not found for -llibopencv_core.2.4.11.dylib
In the error message (g++ -bundle undefined dynamic lookup), I found the following:
-L/usr/local/lib -L/Users/xxx/anaconda/lib -llibopencv_core.2.4.11.dylib
I had installed opencv version 2.4.11 with brew and checked to make sure the libraries were where they were supposed to be (in /usr/local/lib). Since it seemed that it was also searching for the library in /anaconda/lib, I installed opencv through conda and updated the setup.py file to reflect the version change (conda installed 2.4.8). This still yielded no results.
I then tried running the following commands in 3 different directors (/usr/local/lib, /usr/local/Cellar/opencv/2.4.11_1/lib, and /Users/xxx/anaconda/lib to figure out where ld was looking for the libraries
ld -L/usr/local/Cellar/opencv/2.4.11_1/lib -llibopencv_core.2.4.11.dylib
I got back the exact same error as when I ran setup.py build.
I also have tried changing the name (i.e. -lopencv_core instead of -llibopencv_core) but still have had no luck. Can anyone please help me out? Thanks!
Upvotes: 1
Views: 881
Reputation: 507
I figured out the answer. In case anyone is wondering, in osx, you'll want to exclude the lib (so -lopencv_core). Also, -l automatically assumes the .dylib extension, so you'll want to leave that out.
Upvotes: 2