首页 文章

Apple O-Linker尝试在已经工作的项目中使用OpenCV框架时出错

提问于
浏览
2

我所做的是使用了基于openCV框架的tutorial中的一些代码 . 从 EdgeDetectionSample.cpp 文件中,我导入代码 .

架构armv7的未定义符号:“std :: __ 1 :: basic_string,std :: __ 1 :: allocator> :: basic_string(std :: __ 1 :: basic_string,std :: __ 1 :: allocator> const&)”,引用自:cv :: Exception :: Exception(int,std :: __ 1 :: basic_string,std :: __ 1 :: allocator> const&,std :: __ 1 :: basic_string,std :: __ 1 :: allocator> const&,std :: open_vc2(system.o)中的__1 :: basic_string,std :: __ 1 :: allocator> const&,int)cv :: Exception :: Exception(cv :: Exception const&)in opencv2(system.o)“std :: __ 1 :: basic_string,std :: __ 1 :: allocator> :: ~basic_string()“,引用自:cv :: Mat :: create(int,int const *,int)in opencv2(matrix.o)__ ZN2cvL7setSizeERNS_3MatEiPKiPKmb in opencv2( matrix.o)cv :: Mat :: Mat(cv :: Mat const&,cv :: Range const&,cv :: Range const&)in opencv2(matrix.o)cv :: Mat :: Mat(cv :: Mat const& opencv2中的opencv2(matrix.o)cv :: Mat :: diag(int)const中的,cv :: Range const *)opencv2中的opencv2(matrix.o)cv :: Mat :: Mat(IplImage const *,bool)中的const( matrix.o)cv :: mat :: reserve(unsigned long)in opencv2(matrix.o)...“std :: __ 1 :: basic_string ,std :: __ 1 :: allocator> :: __ init(char const *,unsigned long)“,引用自:cv :: Mat :: create(int,int const *,int)in opencv2(matrix.o)_ ZN2cvL7setSizeERNS_3MatEiPKiPKmb in opencv2(matrix.o)cv :: Mat :: Mat(cv :: Mat const&,cv :: Range const&,cv :: Range const&)in opencv2(matrix.o)cv :: Mat :: Mat(cv :: mat const&,cv :: Range const *)在opencv2(matrix.o)cv :: Mat :: diag(int)const中opencv2(matrix.o)cv :: Mat :: Mat(_IplImage const *,bool)in opencv2(matrix.o)cv :: mat :: reserve(unsigned long)在opencv2(matrix.o)...“std :: _ 1 :: _ vector_base_common :: __ throw_length_error()const”,引自:std :: _ 1 :: vector,std :: __ 1 :: allocator >> :: _ append(unsigned long)在opencv2(matrix.o)std :: _ 1 :: vector,std :: __ 1 :: allocator >>> :: _ append(unsigned long) )opencv2(matrix.o)std :: _ 1 :: vector,std :: __ 1 :: allocator >> :: _ append(unsigned long)在opencv2(matrix.o)std :: _ 1 :: vector,std :: _1 :: allocator >> :: _ append(unsigned long)在opencv2(matrix.o)std :: _ 1 :: vector,std :: __ 1 :: allocator >>> :: _ append(unsigned long)in opencv2(matrix.o)std :: _ 1 :: vector,std :: __ 1 :: allocator >> :: _ append(unsigned long)在opencv2(matrix.o)std :: _ 1 :: vector,std :: __ 1: :分配器>>> _ _追加(unsigned long)在opencv2(matrix.o)...“std :: __ 1 :: basic_string,std :: __ 1 :: allocator> :: operator =(std :: __ 1 :: basic_string ,std :: __ 1 :: allocator> const&)“,引用自:opencv2(system.o)中的:cv :: Exception :: formatMessage()ld:未找到架构armv7 clang的符号:错误:链接器命令失败退出代码1(使用-v查看调用)

这个你能帮我吗 . 我无法阅读这些错误 .

1 回答

  • 4

    您的项目与 libstd++ (GNU C++ standard library) 相关联,但最新的OpenCV与 libc++ (LLVM C++ standard library with C++ 11 support) 相关联,因此您有两种方法可以解决此问题:

    • 将项目链接到libc

    • 使用libstd重建OpenCV .

    要将项目与libc链接,请转到 - >构建设置 - >查找'C标准库'行并在那里选择libc .

相关问题