Results 1 to 5 of 5

Thread: QtCreator and OpenCV, .dll missing

  1. #1
    Join Date
    Nov 2011
    Posts
    9
    Thanks
    1
    Platforms
    Windows

    Default QtCreator and OpenCV, .dll missing

    Hey guys,

    Sorry for the newb question, I'm really stuck and I don't now how to fix this problem:

    I try to use OpenCV in QtCreator under Windows 7 and I can't get it working.
    I use the .pro and .cpp file below, but when I press debug it shows me an error message: "During startup programm exited with code 0xc0000139."
    I also tried with console, qmake && make, the .exe is created without error message, but when I want to run it, it says libopencv_highgui231.dll is missing. If it was missing, it couldn't create the .exe in the first place, right?
    I tried putting the .dll in the .exe folder, run it and the message "The procedure entry point _ZNSt9exceptionD2Ev could not be located in the dynamic link library libstdc++-6.dll" appeared.
    I have no clue what's happening. Any advice?

    OpenCVtest.pro

    Qt Code:
    1. TEMPLATE = app
    2. QT -= gui
    3. TARGET = SimpleCvApp
    4.  
    5. SOURCES += main.cpp
    6.  
    7. INCLUDEPATH += C:/OpenCV/opencv/modules/core/include \
    8. C:/OpenCV/opencv/modules/highgui/include
    9.  
    10. # you can put the opencv .dll files where you want, this is where they are by default
    11. # if you want to use different compiler or architecture, look for the libraries for your configuration in "OpenCV2.3/build" subfolder
    12. LIBS += -L"C:/OpenCV/opencv/build/x86/mingw/bin"
    13. LIBS += -lopencv_core231 -lopencv_highgui231
    To copy to clipboard, switch view to plain text mode 


    main.cpp

    Qt Code:
    1. #include <opencv2/highgui/highgui.hpp>
    2. #include <opencv2/core/core.hpp>
    3.  
    4. int main(){
    5. cv::Mat image = cv::imread("C:/Users/shauri/Projects/OpenCVtest/test.jpg");
    6. cv::namedWindow("My Image");
    7. cv::imshow("My Image", image);
    8. cv::waitKey(-1);
    9. return 0;
    10. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Oct 2007
    Location
    Lake Forest, CA, USA
    Posts
    132
    Thanks
    10
    Thanked 27 Times in 22 Posts
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android

    Default Re: QtCreator and OpenCV, .dll missing

    It's a linking error, clean all, check paths and build again.
    Oleg Shparber

  3. #3
    Join Date
    Nov 2011
    Posts
    9
    Thanks
    1
    Platforms
    Windows

    Default Re: QtCreator and OpenCV, .dll missing

    Quote Originally Posted by Oleg View Post
    It's a linking error, clean all, check paths and build again.
    Can you tell where the linking error is coming from?
    The thing is, that qmake && make creates the .exe file without error, so I thought my linking is correct.
    I've set these paths in the system variables:

    Path=C:\QtSDK\mingw\bin; C:\QtSDK\Desktop\Qt\4.7.4\mingw\bin

    Is something missing?

  4. #4
    Join Date
    Oct 2007
    Location
    Lake Forest, CA, USA
    Posts
    132
    Thanks
    10
    Thanked 27 Times in 22 Posts
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android

    Default Re: QtCreator and OpenCV, .dll missing

    Sorry, but I don't remember why this error occurs (or even I didn't figure it out), just that fixing it was very simple after hours spent to hunt the reason. It is something wrong with OpenCV linking, not with your project.
    Oleg Shparber

  5. The following user says thank you to Oleg for this useful post:

    schludy (5th December 2011)

  6. #5
    Join Date
    Nov 2011
    Posts
    9
    Thanks
    1
    Platforms
    Windows

    Default Re: QtCreator and OpenCV, .dll missing

    Quote Originally Posted by Oleg View Post
    It is something wrong with OpenCV linking, not with your project.
    Thanks for the hint, that led me to the solution and this page:

    http://stackoverflow.com/questions/6971883/qtcreator-and-opencv

    Turns out, using opencv-superpack.exe and the .dll's in that folder is not doing the job.
    Solution: Build OpenCV again, using cmake (step by step here: http://opencv.willowgarage.com/wiki/MinGW)

    Now it's running, with only changing the first LIB to the new build!
    Thanks again!

Similar Threads

  1. Qt Creator and OpenCV , .dll missing
    By schludy in forum Newbie
    Replies: 0
    Last Post: 30th November 2011, 10:11
  2. Problem with QtCreator + OpenCV
    By rastru in forum Newbie
    Replies: 3
    Last Post: 24th September 2010, 21:34
  3. QtCreator 2.0 crashes application working in QtCreator 1.3
    By been_1990 in forum Qt Programming
    Replies: 2
    Last Post: 21st September 2010, 12:58
  4. Qt Creator Problem with QtCreator + OpenCV
    By rastru in forum Qt Tools
    Replies: 0
    Last Post: 28th July 2010, 22:33
  5. Replies: 1
    Last Post: 4th June 2010, 17:14

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.