I’m trying to build OpenCV on OS X 10.6.8. I downloaded the source, then created a build dir, then ran ccmake to configure and then cmake. When I run make, I get the following output:
[laptop] build$ pwd
/Users/jesse.aldridge/OpenCV-2.4.2/build
[laptop] build$ make
...
[ 92%] Built target opencv_perf_photo_pch_dephelp
[ 92%] Built target pch_Generate_opencv_perf_photo
[ 93%] Built target opencv_perf_photo
[ 93%] Built target opencv_test_photo_pch_dephelp
[ 94%] Built target pch_Generate_opencv_test_photo
[ 94%] Built target opencv_test_photo
Linking CXX shared library ../../lib/cv2.so
Undefined symbols for architecture x86_64:
"_PyGILState_Ensure", referenced from:
OnMouse(int, int, int, int, void*)in cv2.cpp.o
OnChange(int, void*)in cv2.cpp.o
NumpyAllocator::allocate(int, int const*, int, int*&, unsigned char*&, unsigned char*&, unsigned long*)in cv2.cpp.o
NumpyAllocator::deallocate(int*, unsigned char*, unsigned char*)in cv2.cpp.o
"_PyGILState_Release", referenced from:
OnMouse(int, int, int, int, void*)in cv2.cpp.o
OnChange(int, void*)in cv2.cpp.o
NumpyAllocator::allocate(int, int const*, int, int*&, unsigned char*&, unsigned char*&, unsigned long*)in cv2.cpp.o
NumpyAllocator::deallocate(int*, unsigned char*, unsigned char*)in cv2.cpp.o
...a bunch of similar errors
I don’t have a lot of experience with C++ so I’m not sure what this error is all about. Any tips?
Here’s the full output: https://gist.github.com/3190726
Once you’re in your
builddirectory, here are the commands:This is what has always worked for me. Don’t forget the two dots at the end of the cmake command. Try that first and if it works, you can try changing options in ccmake. You aren’t supposed to run ccmake before cmake. It’s just an interactive front end to cmake. You shouldn’t run cmake if you’ve used ccmake to generate the make files. Just go straight from ccmake to make.