Ask Your Question

Revision history [back]

with Dev-C++, but got undefined reference

Please help me out. Thanks in advance.

I think I already include the header and library folder, as well as the opencv_world library, but still go the following errors. (I also set the env path variable). Please kindly help to check the following log for me and share some comments of yours, thanks. ps. I already comment out other function calls, except VideoCapture cap(0); and got undefined reference to VideoCapture.

gcc.exe -D__DEBUG__ -c main.cpp -o main.o -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include" -I"C:/Program Files (x86)/Dev-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/4.9.2/include" -I"C:/opencv/build/include" -I"C:/opencv/build/include" -g3

g++.exe -D__DEBUG__ main.o -o webcam_opencv.exe -L"C:/Program Files (x86)/Dev-Cpp/MinGW64/lib" -L"C:/Program Files (x86)/Dev-Cpp/MinGW64/x86_64-w64-mingw32/lib" -L"C:/opencv/build/x64/vc14/lib" -L"C:/opencv/build/x64/vc14/lib" ../../../../../opencv/build/x64/vc14/lib/opencv_world331d.lib -g3

main.o: In function main': C:\Users\Tsai\Documents\Webcam\opencv/main.cpp:9: undefined reference tocv::VideoCapture::VideoCapture(int)' C:\Users\Tsai\Documents\Webcam\opencv/main.cpp:9: undefined reference to `cv::VideoCapture::~VideoCapture()' collect2.exe: error: ld returned 1 exit status

Best Wishes Simon