Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

dyld: Library not loaded: lib/libopencv_core.3.0.dylib Reason: image not found

I am getting the following issue:

/Users/luke/Desktop/trainHOG/trainhog ; exit; dyld: Library not loaded: lib/libopencv_core.3.0.dylib Referenced from: /Users/luke/Desktop/trainHOG/trainhog Reason: image not found Trace/BPT trap: 5 logout

I am using a Mac running OSX v10.9.5 with openCV 3.0 alpha.

The library in question is definitely in the folder. I have tried deleting it and pasting it back into the folder, I have completely deleted and reinstalled openCV and macports, and I have tried the export DYLD_LIBRARY_PATH = "path to dynamic libs here..", but nothing has worked. I have even rebooted my computer on several occasions!

Does anyone have any further suggestions? I am out of ideas

like image 560
user40987 Avatar asked Nov 17 '14 17:11

user40987


2 Answers

OpenCV 3.3 OSX 10.13 fist have a test, you can use clang++ -o a -I ./include -L ./lib -lopencv_core.your.version then you can generate executable file a ,run it ,if have the error massage. you will find the error reason cannot find the lib when you are link.

if you want to solve error on terminal you can use export DYLD_LIBRARY_PATH=your/lib:$DYLD_LIBRARY_PATH if you want to solve error on Xcode in build page , go to "Runpath Search Paths" add you lib path

like image 125
zhangxiang Avatar answered Sep 21 '22 02:09

zhangxiang


If you use

export DYLD_LIBRARY_PATH = "path to dynamic libs here.."

is it applied to the environment of your program? You can check the environment variables of a running process with

ps -p <pid> -wwwE

Does this help?

like image 44
plettix Avatar answered Sep 20 '22 02:09

plettix