Ask Your Question

undefined reference to `cv::imread(std::string const&, int)'

asked 2012-12-26 05:43:40 -0500

Ahsan gravatar image

updated 2012-12-26 05:44:22 -0500

Hello I am using OpenCV 2.4.3 with MinGW using Netbeans. I am testing a simple program but I am unable to compile. The error is /*********/ build/Debug/MinGW-Windows/main.o: In function main': C:\Users\Ahsan\Desktop\ImageProcessing/main.cpp:16: undefined reference tocv::imread(std::string const&, int)' build/Debug/MinGW-Windows/main.o: In function ~Mat': c:/Users/Ahsan/Desktop/opencv/build/include/opencv2/core/mat.hpp:278: undefined reference tocv::fastFree(void)' build/Debug/MinGW-Windows/main.o:c:/Users/Ahsan/Desktop/opencv/build/include/opencv2/core/mat.hpp:298: undefined reference to cv::Mat::copySize(cv::Mat const&)' build/Debug/MinGW-Windows/main.o:c:/Users/Ahsan/Desktop/opencv/build/include/opencv2/core/mat.hpp:367: undefined reference tocv::Mat::deallocate()' collect2: ld returned 1 exit status /**********/ Can you please help me. My program is

int main(int argc, char** argv) { cv::Mat image; image = imread(argv[1], CV_LOAD_IMAGE_COLOR); return 0; }

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2013-01-01 07:00:53 -0500

It means, that compiler cannot find OpenCV dynamic or static libraries. You need to add OpenCV libraries directory to project settings.

edit flag offensive delete link more


How to add openCV libraries, can you help me with code?

Kishore Kumar gravatar imageKishore Kumar ( 2015-09-02 08:54:07 -0500 )edit

Question Tools


Asked: 2012-12-26 05:43:40 -0500

Seen: 18,625 times

Last updated: Jan 01 '13