I'm just starting with OpenCV and am stuck running the sample code on this website.
I made a .cpp
file and copy/pasted the code in.
I ran the following command on the command line:
g++ program.cpp -o program
I got the following errors:
undefined reference to `cv::imread(cv::String const&, int)'
program.cpp:(.text+0x128): undefined reference to `cv::namedWindow(cv::String const&, int)'
program.cpp:(.text+0x17d): undefined reference to `cv::imshow(cv::String const&, cv::_InputArray const&)'
program.cpp:(.text+0x1a5): undefined reference to `cv::waitKey(int)'
/tmp/cceJEar6.o: In function `cv::String::String(char const*)':
program.cpp:(.text._ZN2cv6StringC2EPKc[_ZN2cv6StringC5EPKc]+0x4d): undefined reference to `cv::String::allocate(unsigned long)'
It seems to be a linking problem where it can't find the cv namespace or the opencv libraries