I installed opencv by brew, I tried to reinstall for several times and it didn't help. I have googled for a lot of time but didn't find a valid way to solve this.
I copied a valid opencv from my friend's mac, but the imwrite
function is still not found on my mac
Please help.
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