Results 1 to 12 of 12

Thread: Couldn't link opencv with qt creator , this error happens

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2014
    Posts
    15
    Thanks
    5
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Couldn't link opencv with qt creator , this error happens

    Yeah I fixed the copy thing before using it

    but I'm stupid enough to forget about changing the names to the new version names..

    anyways they're still some problems

    first I added these to my pro file:

    Qt Code:
    1. INCLUDEPATH += C:/opencv249/build/include/
    2. CONFIG( debug, debug|release ) {
    3. #debug libs
    4. LIBS +=-LC:/opencv249/build/x64/vc11/staticlib\
    5. -lopencv_core249d\
    6. -lopencv_highgui249d
    7. }
    8. else {
    9. #release libs
    10. LIBS +=-LC:/opencv249/build/x64/vc11/staticlib\
    11. -lopencv_core249\
    12. -lopencv_highgui249
    13. }
    To copy to clipboard, switch view to plain text mode 

    second here is the includes + code

    Qt Code:
    1. #include<opencv/cv.h>
    2. #include<opencv/highgui.h>
    3.  
    4. void MainWindow::showimage1(){
    5. IplImage*img=cvLoadImage("C:\\Users\\myuser\\QT\\build-CaptureTools-Unnamed-Debug\\Fri May 2 2014_3039.png");
    6. cvNamedWindow("example",CV_WINDOW_AUTOSIZE);
    7. cvShowImage("example",img);
    8. cvWaitKey(0);
    9. cvReleaseImage(&img);
    10. cvDestroyWindow("example");
    11.  
    12. }
    To copy to clipboard, switch view to plain text mode 
    ------------------------------------------

    first I'll start with the notifications that it shows in the issues section along with the errors:

    Qt Code:
    1. C:\opencv249\build\include\opencv2\flann\logger.h:66: warning: C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
    2.  
    3. C:\opencv249\build\include\opencv2\flann\logger.h:66: warning: C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
    4.  
    5. C:\opencv249\build\include\opencv2\flann\logger.h:66: warning: C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
    To copy to clipboard, switch view to plain text mode 


    -----------------------------------------------------

    the errors:

    Qt Code:
    1. mainwindow.obj:-1: error: LNK2019: unresolved external symbol _cvReleaseImage referenced in function "public: void __thiscall MainWindow::showimage1(void)" (?showimage1@MainWindow@@QAEXXZ)
    2.  
    3. mainwindow.obj:-1: error: LNK2019: unresolved external symbol _cvNamedWindow referenced in function "public: void __thiscall MainWindow::showimage1(void)" (?showimage1@MainWindow@@QAEXXZ)
    4.  
    5. mainwindow.obj:-1: error: LNK2019: unresolved external symbol _cvShowImage referenced in function "public: void __thiscall MainWindow::showimage1(void)" (?showimage1@MainWindow@@QAEXXZ)
    6.  
    7. mainwindow.obj:-1: error: LNK2019: unresolved external symbol _cvDestroyWindow referenced in function "public: void __thiscall MainWindow::showimage1(void)" (?showimage1@MainWindow@@QAEXXZ)
    8.  
    9. mainwindow.obj:-1: error: LNK2019: unresolved external symbol _cvLoadImage referenced in function "public: void __thiscall MainWindow::showimage1(void)" (?showimage1@MainWindow@@QAEXXZ)
    10.  
    11. mainwindow.obj:-1: error: LNK2019: unresolved external symbol _cvWaitKey referenced in function "public: void __thiscall MainWindow::showimage1(void)" (?showimage1@MainWindow@@QAEXXZ)
    12.  
    13. debug\CaptureTools.exe:-1: error: LNK1120: 6 unresolved externals
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    May 2010
    Location
    Romania
    Posts
    1,021
    Thanks
    62
    Thanked 260 Times in 246 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Couldn't link opencv with qt creator , this error happens

    Are you trying to build using the same compiler as opencv version? (from the opencv path is seems to be vc11, that means Visual Studio 2012)

  3. The following user says thank you to Zlatomir for this useful post:

    Being friendzoned sucks (2nd May 2014)

Similar Threads

  1. Qt Creator 5.0.1 and OpenCv 2.4.3 mingw x86
    By marcocadei in forum Installation and Deployment
    Replies: 11
    Last Post: 16th February 2013, 20:20
  2. OpenCV integration with Qt creator
    By mind_freak in forum Qt Programming
    Replies: 11
    Last Post: 8th January 2013, 22:50
  3. Qt Creator and OpenCV , .dll missing
    By schludy in forum Newbie
    Replies: 0
    Last Post: 30th November 2011, 10:11
  4. Problem with openCV compilation in Qt Creator
    By mind_freak in forum Qt Programming
    Replies: 2
    Last Post: 22nd February 2011, 12:26
  5. Using OpenCV with QT creator
    By gmiller39 in forum Newbie
    Replies: 3
    Last Post: 7th July 2010, 15:32

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.