Reputation: 151
I know similar questions has been posted but the solutions I found haven't worked at all for me.
I'm using XCode 4.5 and openCV 2.4.3. I built the library from source, I have the compiler set to LLVM GCC 4.2 and whenever I try to use cvCvtColor(), I get the following error message:
Undefined symbols for architecture x86_64:
"_cvCvtColor referenced from:
_main in main.o
Any insight would be greatly appreciated!
Upvotes: 0
Views: 1360
Reputation: 151
I found the problem and I'm kicking myself. It turns out I didn't import a particular library (libopencv_imgproc to be specific) that cvCvtColor() was on.
Upvotes: 1
Reputation: 89509
In Terminal, "cd" to the directory that contains your OpenCV library (or actually libraries, as I see a few of them are built when I look at this "how to build OpenCV tutorial") and then type in this command:
"nm -arch x86_64 _________.a
" (fill in the name of the library where the underscores are)
This dumps out all the symbols of the library. You can egrep or search for "cvCvtColor
".
My guess is that you've built OpenCV for 32-bit only (and this will be easy to see if you get absolutely no symbols when specifying "-arch x86_64
" in the "nm
" command) and that you need to also build your OpenCV libraries for 64-bit (x86_64).
Upvotes: 0