Linker error 2019: Opencv 2.3 and qt 4.7.4

Asked By 30 points N/A Posted on -
qa-featured

Hello everyone! I need help on this:

I'm using opencv (of which I have installed all the available updates and upgrades) and qt. I have added all the all the relevant upgrades to CVLoadImage but as soon as I enter any data it crashes.  Please see the following for more information on how I am treating it:

The code I wrote:

void MainWindow:      n_pushButton_clicked()

{

img = cvLoadImage("C:\Users\MLS-PROGRAMER\Documents\Visual Studio 2010\Projects\Image_processing\Image_processing \thres.png"); // cvNamedWindow("Image",CV_WINDOW_AUTOSIZE);

// cvShowImage("Image", img);

// cvWaitKey(40);

}

Error Message:

mainwindow.obj:-1: error: LNK2019: unresolved external symbol _cvLoadImage referenced in function "private: void __thiscall MainWindow:      n_pushButton_clicked(void)" ([email protected]@@AAEXXZ)

SHARE
Answered By 567085 points N/A #148939

Linker error 2019: Opencv 2.3 and qt 4.7.4

qa-featured

From the script you posted above, it seems that there is a slight typographical error in the URL you specified for the file thres.png. Below, I copied the part of your script where an added character was inserted.

img = cvLoadImage("C:\Users\MLS-PROGRAMER\Documents\Visual Studio 2010\Projects\Image_processing\Image_processing \thres.png"); // cvNamedWindow("Image",CV_WINDOW_AUTOSIZE);

From the script above, you happened to insert a “space” after declaring the folder name “Image_processing” [\Image_processing \thres.png] in the URL C:\Users\MLS-PROGRAMER\Documents\Visual Studio 2010\Projects\Image_processing\Image_processing \thres.png. It should be declared as “\Image_processing\thres.png”, without space. The script should be written like this:

img = cvLoadImage("C:\Users\MLS-PROGRAMER\Documents\Visual Studio 2010\Projects\Image_processing\Image_processing\thres.png"); // cvNamedWindow("Image",CV_WINDOW_AUTOSIZE);

The n_pushButton_clicked() function generated an unresolved link error because of the space you accidentally added in the URL of the file thres.png. Try the script again after removing the added space in the URL and check if the error appears again.

Login/Register to Answer

Related Questions