Results 1 to 4 of 4

Thread: Linker error 2019: Opencv 2.3 and qt 4.7.4

  1. #1
    Join Date
    May 2012
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Linker error 2019: Opencv 2.3 and qt 4.7.4

    I am running opencv and qt.I have successfully added the includes for the opencv.But when I am doing cvLoadImage,there is a linker error.

    This is my code:

    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);

    }
    This is the error message:

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

    debug\FIDAS.exe:-1: error: LNK1120: 1 unresolved externals


    My project file is like this

    #-------------------------------------------------
    #
    # Project created by QtCreator 2012-05-29T10:31:40
    #
    #-------------------------------------------------

    QT += core gui

    TARGET = FIDAS
    TEMPLATE = app


    SOURCES += main.cpp\
    mainwindow.cpp

    HEADERS += mainwindow.h

    FORMS += mainwindow.ui


    INCLUDEPATH += C:\OpenCV2.3\opencv\build\include\opencv2\core \
    C:\OpenCV2.3\opencv\build\include\opencv \
    C:\OpenCV2.3\opencv\build\include\opencv2\imgproc \
    C:\OpenCV2.3\opencv\build\gpu\x64\lib \

    CONFIG(release,debug|release)
    {
    LIBS += C:\OpenCV2.3\opencv\build\gpu\x64\lib\opencv_calib 3d231.lib \
    C:\OpenCV2.3\opencv\build\gpu\x64\lib\opencv_contr ib231.lib \
    C:\OpenCV2.3\opencv\build\gpu\x64\lib\opencv_core2 31.lib \
    C:\OpenCV2.3\opencv\build\gpu\x64\lib\opencv_featu res2d231.lib \
    C:\OpenCV2.3\opencv\build\gpu\x64\lib\opencv_flann 231.lib \
    C:\OpenCV2.3\opencv\build\gpu\x64\lib\opencv_gpu23 1.lib \
    C:\OpenCV2.3\opencv\build\gpu\x64\lib\opencv_haart raining_engine.lib \
    C:\OpenCV2.3\opencv\build\gpu\x64\lib\opencv_highg ui231.lib \
    C:\OpenCV2.3\opencv\build\gpu\x64\lib\opencv_imgpr oc231.lib \
    C:\OpenCV2.3\opencv\build\gpu\x64\lib\opencv_legac y231.lib \
    C:\OpenCV2.3\opencv\build\gpu\x64\lib\opencv_ml231 .lib \
    C:\OpenCV2.3\opencv\build\gpu\x64\lib\opencv_objde tect231.lib \
    C:\OpenCV2.3\opencv\build\gpu\x64\lib\opencv_ts231 .lib \
    C:\OpenCV2.3\opencv\build\gpu\x64\lib\opencv_video 231.lib \
    }

    CONFIG(debug,debug|release)
    {
    LIBS += C:\OpenCV2.3\opencv\build\gpu\x64\lib\opencv_calib 3d231d.lib \
    C:\OpenCV2.3\opencv\build\gpu\x64\lib\opencv_contr ib231d.lib \
    C:\OpenCV2.3\opencv\build\gpu\x64\lib\opencv_core2 31d.lib \
    C:\OpenCV2.3\opencv\build\gpu\x64\lib\opencv_featu res2d231d.lib \
    C:\OpenCV2.3\opencv\build\gpu\x64\lib\opencv_flann 231d.lib \
    C:\OpenCV2.3\opencv\build\gpu\x64\lib\opencv_gpu23 1d.lib \
    C:\OpenCV2.3\opencv\build\gpu\x64\lib\opencv_haart raining_engined.lib \
    C:\OpenCV2.3\opencv\build\gpu\x64\lib\opencv_highg ui231d.lib \
    C:\OpenCV2.3\opencv\build\gpu\x64\lib\opencv_imgpr oc231d.lib \
    C:\OpenCV2.3\opencv\build\gpu\x64\lib\opencv_legac y231d.lib \
    C:\OpenCV2.3\opencv\build\gpu\x64\lib\opencv_ml231 d.lib \
    C:\OpenCV2.3\opencv\build\gpu\x64\lib\opencv_objde tect231d.lib \
    C:\OpenCV2.3\opencv\build\gpu\x64\lib\opencv_ts231 d.lib \
    C:\OpenCV2.3\opencv\build\gpu\x64\lib\opencv_video 231d.lib \
    }


    Any help for this issues would be great.?
    Last edited by lakskant; 30th May 2012 at 09:44.

  2. #2
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Linker error 2019: Opencv 2.3 and qt 4.7.4

    you should add library path

    C:\OpenCV2.3\opencv\build\gpu\x64\lib
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  3. #3
    Join Date
    May 2012
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Linker error 2019: Opencv 2.3 and qt 4.7.4

    Thanks for replying..In fact, this is my whole program, I was just starting to test the opencv functions.

    I tried your solution by including it in the include path.but it does not work.

    I am fairly new to c++ and qt.sorry If I ask stupid questions.

  4. #4
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Linker error 2019: Opencv 2.3 and qt 4.7.4

    no, you should not add it to the include path - that is for header searches, not library searches.


    really, you should not be typing out absolute pathseither. you should add the library path,

    C:\OpenCV2.3\opencv\build\gpu\x64\lib

    then add the libs just by name,

    opencv_ts231d.lib
    ...
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

Similar Threads

  1. Linker error with .obj
    By Wasabi in forum Newbie
    Replies: 0
    Last Post: 3rd August 2011, 16:49
  2. OpenCV again (Linker Problems)
    By embedded123 in forum Newbie
    Replies: 1
    Last Post: 28th April 2011, 11:32
  3. LNK 2019 Error while compiling qt program in VS2008
    By mevkurray in forum Qt for Embedded and Mobile
    Replies: 3
    Last Post: 7th February 2010, 00:29
  4. 2019 linker error
    By bmn in forum Newbie
    Replies: 10
    Last Post: 29th July 2008, 00:56
  5. Linker error
    By Tavit in forum Qt Programming
    Replies: 1
    Last Post: 14th July 2008, 14:30

Tags for this Thread

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.