Ask Your Question
-1

ld: library not found for -lopencv_calib3d.2.4.3

asked 2013-07-16 03:47:29 -0600

dredre gravatar image

Hi,

I'm working on a mac 10.7.5 and xcode 4.6.2. I've followed a tutorial to install opencv and cmake.

In terminal :

 mkdir build
cd build
cmake -D WITH_TBB=OFF -D BUILD_NEW_PYTHON_SUPPORT=OFF -D BUILD_FAT_JAVA_LIB=OFF -D BUILD_TBB=OFF -D BUILD_EXAMPLES=ON -D CMAKE_CXX_COMPILER=g++ CMAKE_CC_COMPILER=gcc -D CMAKE_OSX_ARCHITECTURES=x86_64 -D BUILD_opencv_java=OFF -G "Unix Makefiles" ..
make -j8
sudo make install

I've opened up Xcode and added the .dylib files from /usr/local/lib changed the header files

Then I wrote an include to test:

#include <opencv2/opencv.hpp>
#include <opencv2/highgui/highgui.hpp>

The error I'm getting is :

ld: library not found for -lopencv_calib3d.2.4.3
collect2: ld returned 1 exit status
Command /Applications/Xcode.app/Contents/Developer/usr/bin/llvm-g++-4.2 failed with exit code 1

Can anyone give me a hand fixing this? Would be greatly appreciated!

edit retag flag offensive close merge delete

Comments

It states that the library isn't found. Are you sure that your are including the correct linker settings in your project configuration?

StevenPuttemans gravatar imageStevenPuttemans ( 2013-07-16 06:56:52 -0600 )edit

I have libopencv_calib3d.2.4.3.dylib in my project so I'm not sure why it is missing

dredre gravatar imagedredre ( 2013-07-16 07:28:31 -0600 )edit

Sorry by linker settings, do you mean changing the header search path?

dredre gravatar imagedredre ( 2013-07-16 08:11:07 -0600 )edit

I know on windows you have to set linker options and set a global path variable to your opencv functions, I am sure xcode has a same sort of setup :) However I do not have hands on experience with it.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-07-16 08:25:13 -0600 )edit

Okay I'll look into it. Thanks!

dredre gravatar imagedredre ( 2013-07-16 10:59:46 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2014-10-21 20:57:46 -0600

Arpit gravatar image

you can try this OpencvXcodeTemplate

You will have opencv running on Xcode in 2min :)

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-07-16 03:47:29 -0600

Seen: 1,581 times

Last updated: Oct 21 '14