(OS X) OpenCV架构x86_64的未定义符号:错误(OpenCV Undefined symbols for architecture x86_64: error)...
生活随笔
收集整理的這篇文章主要介紹了
(OS X) OpenCV架构x86_64的未定义符号:错误(OpenCV Undefined symbols for architecture x86_64: error)...
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
原地址:
http://www.it1352.com/474798.html
錯(cuò)誤提示如下:
Undefined symbols for architecture x86_64:"cv::_InputArray::_InputArray(cv::Mat const&)", referenced from:_main in test-41a30e.o"cv::namedWindow(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int)", referenced from:_main in test-41a30e.o"cv::destroyWindow(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:_main in test-41a30e.o"cv::Mat::deallocate()", referenced from:cv::Mat::release() in test-41a30e.o"cv::imread(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int)", referenced from:_main in test-41a30e.o"cv::imshow(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, cv::_InputArray const&)", referenced from:_main in test-41a30e.o"cv::waitKey(int)", referenced from:_main in test-41a30e.o"cv::fastFree(void*)", referenced from:cv::Mat::~Mat() in test-41a30e.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)解決方法:
brew install pkg-config brew reinstall opencv # 加入如下參數(shù)編譯 g++ $(pkg-config --cflags --libs opencv) test.cpp -o Test # 運(yùn)行程序 ./Test轉(zhuǎn)載于:https://www.cnblogs.com/theodoric008/p/9262395.html
總結(jié)
以上是生活随笔為你收集整理的(OS X) OpenCV架构x86_64的未定义符号:错误(OpenCV Undefined symbols for architecture x86_64: error)...的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: noi2018
- 下一篇: 持续集成,持续交付,持续部署