I am trying to link a dynamic library (dylib) on mac mountian-lion. Nothing I try has worked.
$ gcc main.cpp -l/usr/local/lib/libopencv_core.2.4.6.dylib ld: library not found for -llibopencv_core.2.4.6.dylib
The library exists:
$ ls /usr/local/lib/libopencv_core.2.4.6.dylib /usr/local/lib/libopencv_core.2.4.6.dylib
I get the same null result using clang. Using otool to reveal dependencies ...
$ otool -L /usr/local/lib/libopencv_core.2.4.6.dylib /usr/local/lib/libopencv_core.2.4.6.dylib: lib/libopencv_core.2.4.dylib (compatibility version 2.4.0, current version 2.4.6) /System/Library/Frameworks/OpenCL.framework/Versions/A/OpenCL (compatibility version 1.0.0, current version 1.0.0) /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 56.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)
I am not sure what the problem is, it could be a versioning issue, I do not know. I am probably missing something simple but essential: can anyone tell me what I am missing?