我在 arm 板上使用 opencv,带有 cortex a8 处理器并在 Debian 上运行。我想使用处理器的 fpu 来提高我的应用程序的性能,所以我使用工具链成功地交叉编译了 opencv(遵循本指南)为此目的而生成。
话虽如此,我没有使用静态库的经验。当我编译我的代码时,我得到了很多链接错误。显然,它们与 zlib 或 zlib2 有关,正如我在这个主题上看到的那样。事情是,我没有启用 png 支持,但我仍然得到那些链接错误:
cxpersistence.cpp:(.text._ZL8icvCloseP13CvFileStorage+0x24): undefined reference to `gzclose'
/cv-lib-arm-hf/lib/libcxcore.a(cxpersistence.o): In function `icvPuts(CvFileStorage*, char const*)':
cxpersistence.cpp:(.text._ZL7icvPutsP13CvFileStoragePKc+0x3c): undefined reference to `gzputs'
/cv-lib-arm-hf/lib/libcxcore.a(cxpersistence.o): In function `icvGets(CvFileStorage*, char*, int)':
cxpersistence.cpp:(.text._ZL7icvGetsP13CvFileStoragePci+0x4c): undefined reference to `gzgets'
/cv-lib-arm-hf/lib/libcxcore.a(cxpersistence.o): In function `icvEof(CvFileStorage*)':
cxpersistence.cpp:(.text._ZL6icvEofP13CvFileStorage+0x30): undefined reference to `gzeof'
cxpersistence.cpp:(.text._ZL6icvEofP13CvFileStorage+0xc4): undefined reference to `gzeof'
/cv-lib-arm-hf/lib/libcxcore.a(cxpersistence.o): In function `cvOpenFileStorage':
cxpersistence.cpp:(.text.cvOpenFileStorage+0x674): undefined reference to `gzopen'
cxpersistence.cpp:(.text.cvOpenFileStorage+0xae8): undefined reference to `gzrewind'
cxpersistence.cpp:(.text.cvOpenFileStorage+0xb98): undefined reference to `gzrewind'
/cv-lib-arm-hf/lib/libcxcore.a(cxlapack.o): In function `cv::SVD::operator()(cv::Mat const&, int)':
cxlapack.cpp:(.text._ZN2cv3SVDclERKNS_3MatEi+0x2b0): undefined reference to `dgesdd_'
cxlapack.cpp:(.text._ZN2cv3SVDclERKNS_3MatEi+0x4b8): undefined reference to `dgesdd_'
cxlapack.cpp:(.text._ZN2cv3SVDclERKNS_3MatEi+0x74c): undefined reference to `sgesdd_'
cxlapack.cpp:(.text._ZN2cv3SVDclERKNS_3MatEi+0x874): undefined reference to `sgesdd_'
/cv-lib-arm-hf/lib/libcxcore.a(cxlapack.o): In function `cv::eigen(cv::Mat const&, cv::Mat&, cv::Mat&, bool, int, int)':
cxlapack.cpp:(.text._ZN2cvL5eigenERKNS_3MatERS0_S3_bii+0x4bc): undefined reference to `dsyevr_'
cxlapack.cpp:(.text._ZN2cvL5eigenERKNS_3MatERS0_S3_bii+0x66c): undefined reference to `dsyevr_'
cxlapack.cpp:(.text._ZN2cvL5eigenERKNS_3MatERS0_S3_bii+0xa7c): undefined reference to `ssyevr_'
cxlapack.cpp:(.text._ZN2cvL5eigenERKNS_3MatERS0_S3_bii+0xc30): undefined reference to `ssyevr_'
/cv-lib-arm-hf/lib/libcxcore.a(cxlapack.o): In function `cv::solve(cv::Mat const&, cv::Mat const&, cv::Mat&, int)':
cxlapack.cpp:(.text._ZN2cv5solveERKNS_3MatES2_RS0_i+0x760): undefined reference to `dgelsd_'
cxlapack.cpp:(.text._ZN2cv5solveERKNS_3MatES2_RS0_i+0x8fc): undefined reference to `dgelsd_'
cxlapack.cpp:(.text._ZN2cv5solveERKNS_3MatES2_RS0_i+0xb8c): undefined reference to `dgesv_'
cxlapack.cpp:(.text._ZN2cv5solveERKNS_3MatES2_RS0_i+0x1018): undefined reference to `dpotrf_'
cxlapack.cpp:(.text._ZN2cv5solveERKNS_3MatES2_RS0_i+0x105c): undefined reference to `dpotrs_'
cxlapack.cpp:(.text._ZN2cv5solveERKNS_3MatES2_RS0_i+0x10d4): undefined reference to `dgels_'
cxlapack.cpp:(.text._ZN2cv5solveERKNS_3MatES2_RS0_i+0x115c): undefined reference to `dgels_'
cxlapack.cpp:(.text._ZN2cv5solveERKNS_3MatES2_RS0_i+0x11e0): undefined reference to `sgelsd_'
cxlapack.cpp:(.text._ZN2cv5solveERKNS_3MatES2_RS0_i+0x123c): undefined reference to `sgelsd_'
cxlapack.cpp:(.text._ZN2cv5solveERKNS_3MatES2_RS0_i+0x12e0): undefined reference to `spotrf_'
cxlapack.cpp:(.text._ZN2cv5solveERKNS_3MatES2_RS0_i+0x1324): undefined reference to `spotrs_'
cxlapack.cpp:(.text._ZN2cv5solveERKNS_3MatES2_RS0_i+0x1398): undefined reference to `sgels_'
cxlapack.cpp:(.text._ZN2cv5solveERKNS_3MatES2_RS0_i+0x13e8): undefined reference to `sgels_'
cxlapack.cpp:(.text._ZN2cv5solveERKNS_3MatES2_RS0_i+0x1468): undefined reference to `sgesv_'
/cv-lib-arm-hf/lib/libcxcore.a(cxlapack.o): In function `cv::determinant(cv::Mat const&)':
cxlapack.cpp:(.text._ZN2cv11determinantERKNS_3MatE+0x298): undefined reference to `dgetrf_'
cxlapack.cpp:(.text._ZN2cv11determinantERKNS_3MatE+0x40c): undefined reference to `sgetrf_'
/cv-lib-arm-hf/lib/libcxcore.a(cxlapack.o): In function `cv::invert(cv::Mat const&, cv::Mat&, int)':
cxlapack.cpp:(.text._ZN2cv6invertERKNS_3MatERS0_i+0x460): undefined reference to `dgetri_'
cxlapack.cpp:(.text._ZN2cv6invertERKNS_3MatERS0_i+0x4c8): undefined reference to `dgetrf_'
cxlapack.cpp:(.text._ZN2cv6invertERKNS_3MatERS0_i+0x7e4): undefined reference to `dpotrf_'
cxlapack.cpp:(.text._ZN2cv6invertERKNS_3MatERS0_i+0x82c): undefined reference to `sgetri_'
cxlapack.cpp:(.text._ZN2cv6invertERKNS_3MatERS0_i+0xa78): undefined reference to `sgetrf_'
cxlapack.cpp:(.text._ZN2cv6invertERKNS_3MatERS0_i+0xab0): undefined reference to `sgetri_'
cxlapack.cpp:(.text._ZN2cv6invertERKNS_3MatERS0_i+0xaf8): undefined reference to `dgetri_'
cxlapack.cpp:(.text._ZN2cv6invertERKNS_3MatERS0_i+0xb28): undefined reference to `spotrf_'
cxlapack.cpp:(.text._ZN2cv6invertERKNS_3MatERS0_i+0xb5c): undefined reference to `spotri_'
cxlapack.cpp:(.text._ZN2cv6invertERKNS_3MatERS0_i+0xb84): undefined reference to `dpotri_'
谁能阐明我需要做什么?我错过了什么?
更新:
我尝试使用相同的工具链编译 zlib 和 bzip2,但错误仍然存在。现在我不知道我做错了什么。有人可以帮忙吗?