C++ 未定义对“CVGetOptimizeDFTSIZE';

C++ 未定义对“CVGetOptimizeDFTSIZE';,c++,opencv,linker,g++,arm,C++,Opencv,Linker,G++,Arm,我正在arm linux上使用Opencv-2.1。我正在使用arm-linux-g++编译器。我在链接过程中遇到了一个奇怪的错误。在讨论错误之前,我将发布make命令 CC = arm-linux-g++ COMPILEFLAGS = -Wall -fPIC -c -O2 -I./ OUT_DLL = libLensFinder.so DLL_FLAGS = -shared -o OBJS = SegmentRegions.o OBJS2 = EdgeDetection.o OBJS3 =

我正在arm linux上使用Opencv-2.1。我正在使用arm-linux-g++编译器。我在链接过程中遇到了一个奇怪的错误。在讨论错误之前,我将发布make命令

CC = arm-linux-g++
COMPILEFLAGS = -Wall -fPIC -c -O2 -I./

OUT_DLL = libLensFinder.so
DLL_FLAGS = -shared -o
OBJS = SegmentRegions.o
OBJS2 = EdgeDetection.o
OBJS3 = AnalyseRegions.o
OBJS4 = global.o
LINK_FLAGS = -L./ -lLensFinder
LINK_FLAGS_2 = -L./ -lTwoX
INCPATH    = -I/home/zwang/ravi/opencv_include21/opencv/  -I.

all : 
$(CC) $(COMPILEFLAGS) $(INCPATH) global.cpp -o global.o
$(CC) $(COMPILEFLAGS) $(INCPATH) EdgeDetection.cpp -o EdgeDetection.o
$(CC) $(COMPILEFLAGS) $(INCPATH) SegmentRegions.cpp -o SegmentRegions.o
$(CC) $(COMPILEFLAGS) $(INCPATH) AnalyseRegions.cpp -o AnalyseRegions.o
$(CC) $(OBJS) $(OBJS2) $(OBJS3) $(OBJS4) $(DLL_FLAGS) ./$(OUT_DLL) -L/home/zwang/ravi/opencv_include21/lib -lcvaux -lcxcore -lhighgui -lcv -lml -lcxts -lrt

$(CC) $(COMPILEFLAGS) $(INCPATH) sample.cpp
#$(CC) $(LINK_FLAGS) sample.o -o sample 
$(CC) $(LINK_FLAGS) $(LINK_FLAGS_2) sample.o -o sample 
一切顺利,直到最后。在最后一个命令期间,即在创建可执行文件时,我遇到以下错误

arm-linux-g++ -L./ -lLensFinder -L./ -lTwoX sample.o -o sample
.//libLensFinder.so: undefined reference to `spotrs_'
.//libLensFinder.so: undefined reference to `cvGetOptimalDFTSize'
.//libLensFinder.so: undefined reference to `dgels_'
.//libLensFinder.so: undefined reference to `dgelsd_'
.//libLensFinder.so: undefined reference to `dgesdd_'
.//libLensFinder.so: undefined reference to `cvMulSpectrums'
.//libLensFinder.so: undefined reference to `sgesdd_'
.//libLensFinder.so: undefined reference to `sgetri_'
.//libLensFinder.so: undefined reference to `cvDFT'
.//libLensFinder.so: undefined reference to `dgesv_'
.//libLensFinder.so: undefined reference to `dgetrf_'
.//libLensFinder.so: undefined reference to `dsyevr_'
.//libLensFinder.so: undefined reference to `sgels_'
.//libLensFinder.so: undefined reference to `spotrf_'
.//libLensFinder.so: undefined reference to `sgetrf_'
.//libLensFinder.so: undefined reference to `dpotrf_'
.//libLensFinder.so: undefined reference to `dpotri_'
.//libLensFinder.so: undefined reference to `sgesv_'
.//libLensFinder.so: undefined reference to `ssyevr_'
.//libLensFinder.so: undefined reference to `dpotrs_'
.//libLensFinder.so: undefined reference to `sgelsd_'
.//libLensFinder.so: undefined reference to `spotri_'
.//libLensFinder.so: undefined reference to `dgetri_'
collect2: ld returned 1 exit status
make: *** [all] Error 1

其中两个未定义的引用是
cvMulSpectrums'和
cvgetoptimizedftsize',我猜这是由于opencv。我对其他未定义的引用没有任何线索。我想我已经把每个图书馆都联系起来了。但仍然不明白如何解决这个问题。有什么建议吗?仅供参考,代码正在visual studio上运行

这些符号是在
libopencv\u核心
库文件中定义的

注意,命令
arm-linux-g++-L./-lLensFinder-L./-lTwoX sample.o-o sample
没有将sample链接到任何opencv库,因此链接过程抱怨它是有道理的

您可能应该调整构建以执行以下操作:

arm-linux-g++ sample.o -o sample -L./ -lLensFinder -L./ -lTwoX -L/home/zwang/ravi/opencv_include21/lib -lcvaux -lcxcore -lhighgui -lcv -lml -lcxts -lrt

你推荐的库,-嗯,它们没有死,但它们闻起来肯定像opencv1.1。你好,我明白你的意思。然而,除了OP在问题中所说的以外,我不推荐任何东西。“你可能想补充一个答案,指出这一点,我认为这很重要。”卡尔菲利普说。谢谢你的解决方案。是的,你说得对。它起作用了。我观察到体育、球类等属于第三方lapack。我也链接了那个图书馆。而且效果很好。谢谢