I am compiling a program with the following flags and getting errors (running 64 bit os):
g++ -lm -lml -lcvaux -lhighgui -lcv -lcxcore main.o BRIEF.o -o BRIEF_demo
I get a bunch of undefined references:
main.cpp:(.text+0x1f6): undefined reference to `cvInitMatHeader'
main.cpp:(.text+0x218): undefined reference to cvInitMatHeader'_Z14drawQuadrangleP9_IplImageiiiiiiii8CvScalari.constprop.77′:
main.o: In function
main.cpp:(.text+0x2d5): undefined reference to cvLine'cvLine’
main.cpp:(.text+0x333): undefined reference to
main.cpp:(.text+0x398): undefined reference to cvLine'cvLine’
main.cpp:(.text+0x3f2): undefined reference to
Anyone have an idea how to circumvent this?
I suppose you are using the newest OpenCV 2.3.x.
cvInitMatHeader()andcvLine()are actually defined inlibcxcore.so, which I can see you are including.My guess is that the order of the linking is wrong, so you need to adjust your command to something like: