ext/atomicity.h file not find

openCVforIOS项目里面的一个错误:https://github.com/aptogo/OpenCVForiPhone

bug的原因

这个ios代码用的是早期的opencv ios库,头文件ext/atomicity.h是需要GNU libstdc++ (GNU C++ standard library)编译环境,ios编译提供的LLVM
参考:http://stackoverflow.com/questions/13037659/opencv-build-issue-cant-find-ext-atomicity-h

解决方法

网上说的大多是修改编译配置,用libstdc++编译,比较麻烦,自己试了下也没什么效果。
将原项目里面的opencv.framework删掉,添加最新的opencv2.framework

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
引用\[1\]:/usr/bin/ld: CMakeFiles/main.dir/main.cpp.o: undefined reference to symbol 'shm_unlink@@GLIBC_2.2.5' //lib/x86_64-linux-gnu/librt.so.1: 无法添加符号: DSO missing from command line collect2: error: ld returned 1 exit status CMakeFiles/main.dir/build.make:111: recipe for target 'main' failed make\[2\]: *** \[main\] Error 1 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/main.dir/all' failed make\[1\]: *** \[CMakeFiles/main.dir/all\] Error 2 Makefile:83: recipe for target 'all' failed make: *** \[all\] Error 2 于是乎网上查找资料,解决了,方法是 。 引用\[2\]:最近使用c++11 的标准thread库,发现传参的时候的bug,很隐密。 ... /usr/include/c++/4.8.2/functional:1697:61: error: no type named ‘type’ in ‘class std::result_of<void (*(std::unordered_map<int, int>, int, int))(std::unordered_map<int, int>&, int, int)>’ typedef typename result_of<_Callable(_Args...)>::type result_type; ... 。 引用\[3\]:对于自定义类型,则不一定是lock_free的 #include <atomic> #include <iostream> struct A{ char n\[1\]; }; int main() { std::atomic<A> a; std::cout << "sizeof int: " << sizeof(int) << " byte, " << a.is_lock_free() << std::endl; } 。 问题:\[build\] /usr/include/c++/7/ext/atomicity.h:67: undefined reference to `__ubsan_handle_type_mismatch' 回答: 这个错误是由于链接器无法找到`__ubsan_handle_type_mismatch`符号引起的。\[3\]这个符号通常与Undefined Behavior Sanitizer (UBSan)相关联,它是GCC的一个工具,用于检测C++程序中的未定义行为。要解决这个问题,您可以尝试在链接时添加`-lubsan`选项,以确保链接器能够找到所需的库。具体来说,您可以在CMakeLists.txt文件中的目标链接器命令中添加`-lubsan`选项,或者在命令行中手动添加该选项。这样,链接器就能够找到`__ubsan_handle_type_mismatch`符号并解决链接错误。 #### 引用[.reference_title] - *1* [[C++]共享内存cmake报错undefined reference to symbol ‘shm_unlink@@GLIBC_2.2.5](https://blog.csdn.net/FL1623863129/article/details/128147759)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [c++ thread 带参数编译错误:/usr/include/c++/4.8/functional:1697:61: error: no type named ‘type’ in ‘class st](https://blog.csdn.net/Jack_Zhao_/article/details/88820910)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [C++ error: undefined reference to `__atomic_is_lock_free‘](https://blog.csdn.net/a1367666195/article/details/130617330)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值