[英]OpenCV LDFlags linking issue
I am compiling a program with the following flags and getting errors (running 64 bit os): 我正在编译带有以下标志的程序并收到错误(运行64位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' main.o: In function
_Z14drawQuadrangleP9_IplImageiiiiiiii8CvScalari.constprop.77': main.cpp:(.text+0x2d5): undefined reference to cvLine' main.cpp:(.text+0x333): undefined reference to
cvLine' main.cpp:(.text+0x398): undefined reference to cvLine' main.cpp:(.text+0x3f2): undefined reference to
cvLine' main.cpp :(。text +
cvInitMatHeader' main.o: In function
):对cvInitMatHeader' main.o: In function
未定义引用cvInitMatHeader' main.o: In function
_Z14drawQuadrangleP9_IplImageiiiiiiii8CvScalari.constprop.77'中:main.cpp :(。text + 0x2d5):对cvLine' main.cpp:(.text+0x333): undefined reference to
未定义引用cvLine' main.cpp:(.text+0x333): undefined reference to
cvLine'main.cpp :(。text + 0x398):未定义引用cvLine' main.cpp:(.text+0x3f2): undefined reference to
cvLine'
Anyone have an idea how to circumvent this? 有人知道如何规避吗?
I suppose you are using the newest OpenCV 2.3.x. 我想您正在使用最新的OpenCV2.3.x。
cvInitMatHeader()
and cvLine()
are actually defined in libcxcore.so
, which I can see you are including. cvInitMatHeader()
和cvLine()
实际上是在libcxcore.so
定义的,我可以看到其中包括。
My guess is that the order of the linking is wrong, so you need to adjust your command to something like: 我的猜测是链接的顺序是错误的,因此您需要将命令调整为:
g++ main.cpp BRIEF.cpp -o BRIEF_demo -lm -lml -lcvaux -lhighgui -lcv -lcxcore
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.