Quantcast
Channel: OpenCV Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 41027

Sudden linker error with GCC 5.2.0

$
0
0
I am using OpenCV 2.4 in a project and up to GCC 5.1.0 I had no problems with compiling. Suddenly, after installing GCC 5.2.0 (from source) I get a linker error for some of the OpenCV functions. The majority seems to work. Only the cs::im* functions seem to cause problems. CMakeFiles/2DSIL.dir/main.cpp.o: In function `main': /home/c7031105/Dropbox/2DSIL/main.cpp:35: undefined reference to `cv::imread(std::__cxx11::basic_string, std::allocator> const&, int)' /home/c7031105/Dropbox/2DSIL/main.cpp:110: undefined reference to `cv::imwrite(std::__cxx11::basic_string, std::allocator> const&, cv::_InputArray const&, std::vector> const&)' CMakeFiles/2DSIL.dir/V4.cpp.o: In function `V4::getWeights(std::vector>, double&)': /home/c7031105/Dropbox/2DSIL/V4.cpp:313: undefined reference to `cv::imread(std::__cxx11::basic_string, std::allocator> const&, int)' CMakeFiles/2DSIL.dir/V4.cpp.o: In function `V4::compare(std::vector>, std::__cxx11::basic_string, std::allocator>)': /home/c7031105/Dropbox/2DSIL/V4.cpp:110: undefined reference to `cv::imread(std::__cxx11::basic_string, std::allocator> const&, int)' CMakeFiles/2DSIL.dir/V4.cpp.o: In function `V4::getWeights(cv::Mat, cv::Mat, double&)': /home/c7031105/Dropbox/2DSIL/V4.cpp:352: undefined reference to `cv::imread(std::__cxx11::basic_string, std::allocator> const&, int)' /home/c7031105/Dropbox/2DSIL/V4.cpp:379: undefined reference to `cv::imread(std::__cxx11::basic_string, std::allocator> const&, int)' CMakeFiles/2DSIL.dir/V4.cpp.o: In function `V4::compare(cv::Mat, cv::Mat, std::__cxx11::basic_string, std::allocator>)': /home/c7031105/Dropbox/2DSIL/V4.cpp:179: undefined reference to `cv::imread(std::__cxx11::basic_string, std::allocator> const&, int)' CMakeFiles/2DSIL.dir/V4.cpp.o: In function `void cv::Mat::push_back(int const&)': /usr/local/include/opencv2/core/mat.hpp:689: undefined reference to `cv::Exception::Exception(int, std::__cxx11::basic_string, std::allocator> const&, std::__cxx11::basic_string, std::allocator> const&, std::__cxx11::basic_string, std::allocator> const&, int)' CMakeFiles/2DSIL.dir/img_read_write.cpp.o: In function `dsil::visualize(cv::Mat const&, int)': /home/c7031105/Dropbox/2DSIL/img_read_write.cpp:91: undefined reference to `cv::namedWindow(std::__cxx11::basic_string, std::allocator> const&, int)' /home/c7031105/Dropbox/2DSIL/img_read_write.cpp:92: undefined reference to `cv::imshow(std::__cxx11::basic_string, std::allocator> const&, cv::_InputArray const&)' CMakeFiles/2DSIL.dir/img_read_write.cpp.o: In function `dsil::imgwrite(std::__cxx11::basic_string, std::allocator> const&, std::__cxx11::basic_string, std::allocator> const&, cv::Mat const&)': /home/c7031105/Dropbox/2DSIL/img_read_write.cpp:49: undefined reference to `cv::imwrite(std::__cxx11::basic_string, std::allocator> const&, cv::_InputArray const&, std::vector> const&)' collect2: error: ld returned 1 exit status make[3]: *** [2DSIL] Error 1 make[2]: *** [CMakeFiles/2DSIL.dir/all] Error 2 make[1]: *** [CMakeFiles/2DSIL.dir/rule] Error 2 make: *** [2DSIL] Error 2 Any idea what could cause that?

Viewing all articles
Browse latest Browse all 41027


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>