Error when using imshow on OS X
来源:互联网 发布:互联网大会2017 知乎 编辑:程序博客网 时间:2024/05/16 17:35
I have setup OpenCV2
in XCode but unfortunately imshow
does not work:
Undefined symbols for architecture x86_64: "cv::imshow(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, cv::_InputArray const&)", referenced from: _main in main.old: symbol(s) not found for architecture x86_64clang: error: linker command failed with exit code 1 (use -v to see invocation)
I am running OS X 10.8.4 with latest XCode.
I have attached a few images below to show the setup in XCode and the libraries. So far it seems that other functions work fine with OpenCV, except this.
I'm going to go out on a limb and say that you compiled OpenCV2
withlibstdc++
, and are now compiling your application with libc++
support.
You need to compile OpenCV2 with the same C++
library, otherwise it will not be able to link.
if you do an nm
of the OpenCV2 library, if it was compiled with libstdc++
, it will look like:
cv::imshow(std::string const&, cv::_InputArray const&)
while if it was compiled with libc++
, it would look like:
cv::imshow(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, cv::_InputArray const&)
to get the demangled symbol do:
nm library | c++filt | grep cv::imshow
0 0
- Error when using imshow on OS X
- Using pthread_barrier on Mac OS X
- using zsh on MAC OS X
- Multithreading on iOS And Mac OS X Using NSOperations
- Error handling when using Git
- Compiling and linking error when using NDK r10 to build cocos2d-x v3.2
- Compiling and linking error when using NDK r10 to build cocos2d-x v3.2
- Compiling and linking error when using NDK r10 to build cocos2d-x v3.2
- on error语句,when语句
- HTK on OS X
- sem_init on OS X
- ASP.NET on Mac OS X Snow Leopard at one fell swoop using mod_mono
- oracle中merge into..using..on..when..when..用法
- oracle中merge into..using..on..when..when..用法
- meet error when using maven Updating...
- OS X x86 on VMWare
- OpenCV on Mac OS X
- OpenGL on Mac OS X
- cocoapods安装与管理
- keil uVision4的安装以及KEIL_Lic.exe的注册
- 解决duilib使用zip换肤卡顿的问题(附将资源集成到程序中的操作方法)
- 利用mybatis-generator自动生成JavaBean,mapping映射文件等
- Eclipse超级联想和alt+/ 联想的实现方法
- Error when using imshow on OS X
- auto的使用
- HDU2063(匈牙利算法)
- LeetCode刷题笔录Reverse Words in a String
- 用Github和Octopress搭建博客
- SQLite数据库拼写工具类
- 判断ios程序第一次启动
- Linux系统开机过程详解
- Hibernate工作原理及为什么要用?