views:

141

answers:

2

Hi,

Im creating a project in Xcode using OpenCV as a framework. It works great with the Build&Run option from Xcode, but now I need to run it in the Terminal and it gives me this error:

dyld: Library not loaded: @executable_path/../Frameworks/OpenCV.framework/Versions/A/OpenCV
Referenced from: /Users/Victor/Documents/PFC/src/opencv/blob/build/Release/./test3
Reason: image not found
Trace/BPT trap

I look for the build and just execute it with ./

So, any clue?

A: 

What was the exact command that you ran?

Ciarán Walsh
Inside the Build folder in the project's folder, i ran "./test", which is the name of the build.
Víctor
So ‘test’ is a command-line tool? It looks as though the product is linked in a way that expects the ‘OpenCV’ framework to be bundled inside of the application, but command-line tools do not have a bundle.I’m unsure why this would work from within Xcode, unless it sets some DYLD environment variables. Are you sure that you’re running the same product?
Ciarán Walsh
+2  A: 

You need to run it from the build directory rather than the Release directory (assuming Frameworks is a directory in blob)

Autopulated
In the build folder there are just the more folders: Debug, Release and blob.build. blob.build, which would be the best candidate, has another two folder: Debug and blob.pbxindex
Víctor
ok, I was building it in debug mode, so that means i was sort of an idiot... I buildt it as a release and now I can run the object under Build/Release :)Thanks for you answers!
Víctor