0

I integrated opencv in QT creator. I want to use my camera and display the frames in the mainwindow. After compiling a simple code, where I only want to output a simple message, I get an error (German language) Like:

videocap.obj:-1: Fehler: LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""public: __cdecl cv::VideoCapture::VideoCapture(void)" (??0VideoCapture@cv@@QEAA@XZ)" in Funktion ""public: void __cdecl videoCap::playVideo(void)" (?playVideo@videoCap@@QEAAXXZ)".

Code:

void videoCap:: playVideo(){

  VideoCapture *cap = new VideoCapture();
  if(!cap->isOpened()){

    cout<< "nope" << endl;

  }else{

    cout << "dope" << endl;
  }
}

Can you explain me what I am doing wrong please ?

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
Burkay
  • 91
  • 1
  • 1
  • 11
  • 1
    Read: [What is an undefined reference/unresolved external symbol error and how do I fix it?](https://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix) – Arnav Borborah Apr 21 '18 at 11:09
  • add all the opencv libraries to the linker settings. And make sure that opencv was built with the same compiler that you are using in QtCreator. – Micka Apr 21 '18 at 11:13

0 Answers0