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

[opencv2.4] g++ imread linker error

$
0
0
I got linker error trying to compile this simple code: #include #include #include #include using namespace cv; int main(int argc, char** argv) { std::string filename = argv[1]; Mat A; A = imread(filename); return 0; } Here is the makefile: CXX=g++ LDFLAGS=`pkg-config --libs opencv` CXXFLAGS=-Wall -v CXXFLAGS+=`pkg-config --cflags opencv` cam_calibration.o : cam_calibration.cxx $(CXX) $(CXXFLAGS) $(LDFLAGS) cam_calibration.cxx clean : rm *.o The error is following (after issuing "make"): /tmp/cccbWfsF.o: In function `main': cam_calibration.cxx:(.text+0x6b): undefined reference to `cv::imread(std::string const&, int)' collect2: error: ld returned 1 exit status What is wrong with this code? I'm using Archlinux, g++ (5.2.0) and have all the opencv libraries in version 2.4

Viewing all articles
Browse latest Browse all 41027


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