- File | New | New Project ... (Shift+Cmd+N)
- Mac OS X, Application, Command Line Tool.
- Enter a project name. Change Type to C++.
- Choose place to store project.
- Click the target at the top of the tree on the left. Click your target (not project), then click Build Settings.
- Change Architectures to 64-bit Intel if you're using Mac OS X 10.6, to 32-bit Intel if you're using 10.5.
- Change Build Active Architecture Only, Debug to No.
- Change Header Search Paths to /opt/local/include /opt/local/include/opencv.
- Click Build Phases
- Expand Link Binary With Libraries
- Click +
- Click Add Other
- Navigate to /opt/local/lib
- Cmd+click the libopencv_*.dylib files your project needs (at a minimum you'll need core, highgui and imgproc).
- Click OK
Hey mate
I did what you told me to do and I tried to build an example code that I have, I know that is not working because I haven't finished yet but I got this error.
Ld /Users/camiloleon/Library/Developer/Xcode/DerivedData/OpenCVTest-dvxmawxdmlnefdboqlievdgeaxfg/Build/Products/Debug/OpenCVTest normal x86_64
cd /Users/camiloleon/Desktop/OpenCVTest
setenv MACOSX_DEPLOYMENT_TARGET 10.6
/Developer/usr/bin/clang++ -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.6.sdk -L/Users/camiloleon/Library/Developer/Xcode/DerivedData/OpenCVTest-dvxmawxdmlnefdboqlievdgeaxfg/Build/Products/Debug -L/opt/local/lib -F/Users/camiloleon/Library/Developer/Xcode/DerivedData/OpenCVTest-dvxmawxdmlnefdboqlievdgeaxfg/Build/Products/Debug -filelist /Users/camiloleon/Library/Developer/Xcode/DerivedData/OpenCVTest-dvxmawxdmlnefdboqlievdgeaxfg/Build/Intermediates/OpenCVTest.build/Debug/OpenCVTest.build/Objects-normal/x86_64/OpenCVTest.LinkFileList -mmacosx-version-min=10.6 -lopencv_calib3d.2.2.0 -lopencv_contrib.2.2.0 -lopencv_core.2.2.0 -lopencv_features2d.2.2.0 -lopencv_flann.2.2.0 -lopencv_gpu.2.2.0 -lopencv_highgui.2.2.0 -lopencv_imgproc.2.2.0 -lopencv_legacy.2.2.0 -lopencv_ml.2.2.0 -lopencv_objdetect.2.2.0 -lopencv_video.2.2.0 -o /Users/camiloleon/Library/Developer/Xcode/DerivedData/OpenCVTest-dvxmawxdmlnefdboqlievdgeaxfg/Build/Products/Debug/OpenCVTest
ld: duplicate symbol _main in /Users/camiloleon/Library/Developer/Xcode/DerivedData/OpenCVTest-dvxmawxdmlnefdboqlievdgeaxfg/Build/Intermediates/OpenCVTest.build/Debug/OpenCVTest.build/Objects-normal/x86_64/dip1.o and /Users/camiloleon/Library/Developer/Xcode/DerivedData/OpenCVTest-dvxmawxdmlnefdboqlievdgeaxfg/Build/Intermediates/OpenCVTest.build/Debug/OpenCVTest.build/Objects-normal/x86_64/main.o for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Command /Developer/usr/bin/clang++ failed with exit code 1
Command /Developer/usr/bin/clang++ failed with exit code 1
sorry but I don't know if that is a code error or a build settings error. If would be great if you could help me.
Thanks, what you told me really helps me.