OSX上的Opencv,架构x86_64的未定义符号:未找到cv :: imwrite

时间:2018-03-20 07:19:39

标签: c++ opencv compilation linker

我通过brew安装opencv,我尝试重新安装几次,但没有帮助。我用google搜索了很多时间,但没有找到解决此问题的有效方法。

我从我朋友的mac复制了一个有效的opencv,但我的mac上仍找不到imwrite函数

请帮忙。

bash: g++ $(pkg-config --cflags --libs opencv) BoxFilter.cc -o BoxFilter
In file included from /usr/local/Cellar/opencv/3.3.0_3/include/opencv2/core.hpp:54:0,
                from /usr/local/Cellar/opencv/3.3.0_3/include/opencv2/opencv.hpp:52,
                from BoxFilter.cc:2:
/usr/local/Cellar/opencv/3.3.0_3/include/opencv2/core/base.hpp:354:35: warning: unknown option after '#pragma GCC diagnostic' kind [-Wpragmas]
#   pragma GCC diagnostic ignored "-Winvalid-noreturn"
                                ^
Undefined symbols for architecture x86_64:
"cv::imwrite(cv::String const&, cv::_InputArray const&, std::vector<int, std::allocator<int> > const&)",referenced from:
    _main in ccO7bsE6.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status

0 个答案:

没有答案