Opencv Undefined symbols for architecture cv:imwrite Mac osX high Sierra
问题 I downloaded GCC and opencv(3.4.1_2) in my Mac OS X high Sierra(10.13.3) through homebrew. $ g++ --version g++-7 (Homebrew GCC 7.3.0_1) 7.3.0 In my "opencvtest.cpp", cv::imwrite was seen as undefined symbols for architecture but other functions such as cv::imread, cv::namedWindow worked perfectly. #include "opencv2/highgui/highgui.hpp" #include "opencv2/imgcodecs.hpp" #include <iostream> using namespace cv; int main( int argc, char** argv ) { Mat img = imread( argv[1], -1 ); if( img.empty() )