I have listed some easy and straight-forward steps below to get OpenCV library working with XCode on Mac OS X Lion without installing unnecessary bulky software on your Mac. Installing CMake i. CMake is essential to build OpenCV on UNIX. Get CMake Mac OS X binary (dmg) from. This comes with a GUI installer, making the installation process easy. At the end of the CMake installation it will ask whether or not to put CMake into /usr/bin and into PATH environment variable, select Yes and finish the installation. Open the Terminal ( Launch Pad - Utilities - Terminal) and make sure that CMake is successfully installed by entering the following command.
Dec 29, 2014 - I've set the Build Settings -> c++ standard library to Compiler Default. For me, I use opencv in xcode for iOS, and I solve the errors by using the opencv through. Imread has been moved in the opencv_imgcodecs library. Try to add -lopencv_imgcodecs to your linker flags.
It should output the CMake version you have installed. Anonymous Thank you very much for your reply! I tried installing OpenCV by following these steps, however after the cmake -G 'Unix Makefiles'. Command the following error occurs CMake Error: CMake was unable to find a build program corresponding to 'Unix Makefiles'. CMAKEMAKEPROGRAM is not set. You probably need to select a different build tool.
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. Missing variable is: CMAKECCOMPILERENVVAR CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. Missing variable is: CMAKECCOMPILER CMake Error: Could not find cmake module file:/Users/arihant/Downloads/OpenCV-2.3.1/build/CMakeFiles/2.8.10.2/CMakeCCompiler.cmake CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly. Missing variable is: CMAKECXXCOMPILERENVVAR CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is: CMAKECXXCOMPILER CMake Error: Could not find cmake module file:/Users/arihant/Downloads/OpenCV-2.3.1/build/CMakeFiles/2.8.10.2/CMakeCXXCompiler.cmake CMake Error: CMAKECCOMPILER not set, after EnableLanguage CMake Error: CMAKECXXCOMPILER not set, after EnableLanguage - Configuring incomplete, errors occurred! I would appreciate if you could help me out with this. Thank you anonymous and Sadeep!, i was able to successfully build and install OpenCV-2.4.3 on my mac, however when i build the code, another error occurs. Anonymous You have to configure a user defined header search path for the compiler that points to the opencv2 directory containing the opencv.hpp file. Here's how you do it: 1. Open Finder on your Mac and search for the location of the file opencv.hpp (it should be in a directory called opencv2) 2. In xCode, click on the project name in the project navigator to get to the Build Settings 3.
In the Build Settings search for 'search paths' 4. Change 'Always Search User Paths' to Yes 5. Add to 'User Header Search Paths' the path to THE DIRECTORY opencv2 you found in step 1. (It should looks something like: /Users/myname/Downloads/opencv-2.4.10/include) #include should now work. This is the error i get when i try execting make command. Hi all, Before starting i'm sorry to post here but i didn't find where else to post this.
I'm quite a begginner with OpenCV since I just Install it on my mac. And i've a big problem of image size. When I compile a code I used to work on on Linux, with many 'imshow', all the image are really Huge and i can't reduce their size without loosing some information. (i.e I can reduce the size of the window but if I do it, i can't see all the image inside). And I don't have this problem on Linux. Does someone had this problem before?
![For For](http://answers.opencv.org/upfiles/14802336367379643.png)
Thanks you all;). Anonymous Hi, I'm trying to install opencv and get the following errors after the make command: 95% Building CXX object modules/python/CMakeFiles/opencvpython.dir/src2/cv2.cpp.o In file included from /Users/Oscar/opencv-2.4.6.1/modules/python/src2/cv2.cpp:1: In file included from /Library/Frameworks/Python.framework/Headers/Python.h:57: /Library/Frameworks/Python.framework/Headers/pyport.h:761:2: error: #error 'LONGBIT definition appears wrong for platform (bad gcc/glibc config?).' #error 'LONGBIT definition appears wrong for platform (bad gcc/glibc config?).' ^ 1 error generated. Make2:. modules/python/CMakeFiles/opencvpython.dir/src2/cv2.cpp.o Error 1 make1:.
modules/python/CMakeFiles/opencvpython.dir/all Error 2 make:. all Error 2 Any chance you know how to fix this? Anonymous Thanks for great tutorial for beginner opencv in Mac. I have trouble with installing cmake -G 'Unix Makefiles'. Please help me to solve that, i have no idea:( Undefined symbols for architecture x8664: 'cv::VideoWriter::release', referenced from: vtable for cv::VideoWriter in cap.o ld: symbol(s) not found for architecture x8664 clang: error: linker command failed with exit code 1 (use -v to see invocation) make2:. lib/libopencvhighgui.2.3.1.dylib Error 1 make1:. modules/highgui/CMakeFiles/opencvhighgui.dir/all Error 2 make:.
all Error 2. Anonymous To install OpenCV using the terminal on Ubuntu: $ su - # apt-get update # apt-get install build-essential # apt-get install libavformat-dev # apt-get install x264 v4l-utils ffmpeg # apt-get install libcv2.3 libcvaux2.3 libhighgui2.3 python-opencv opencv-doc libcv-dev libcvaux-dev libhighgui-dev OpenCV should be installed in /usr/local/ Installation Directory You may also want to compile and view examples $ cp -r /usr/share/doc/opencv-doc/examples. $ cd examples $ cd c $ sh buildall.sh Source: http://namhuy.net/1205/how-to-install-opencv-on-ubuntu.html. Anonymous hi sadeep, Im getting the following error. Determining if the CXX compiler works failed with the following output: Change Dir: /Users/saravanand/Downloads/opencv-2.4.9/build/CMakeFiles/CMakeTmp Run Build Command:'/usr/bin/make' 'cmTryCompileExec/fast' /Volumes/Server HD/Applications/Xcode 2.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTryCompileExec.dir/build.make CMakeFiles/cmTryCompileExec.dir/build make: /Volumes/Server: No such file or directory make:. cmTryCompileExec/fast Error 1.
Hi Sadeep, Thanks for the blog. I have successfully finished all the instruction from ' Installing Cmake' to 'Installing OpenCV.' However, I am stuck in the following steps because there are no results after typing /usr/local/lib in the searching box of adding files window. What might be the cause for this problem?
Thank you, v.) A new file selector window will open. Press '/' key to open Go to folder box. Type /usr/local/lib there and hit Return.
Vi.) Select the following files from /usr/local/lib and add them to your project. Libopencvcore.2.3.1.dylib libopencvhighgui.2.3.1.dylib.