Opencv libs are not found - HELP

  • Hey,
    i want to use the opencv libs.
    this is a part of my .pro file :
    INCLUDEPATH += "D:\OpenCV\debug\include"
    LIBS += "D:\OpenCV\debug\lib*.dll.a"

    when compiling the project no error occurs but starting the .exe throws "cannot find *.dll".
    but starting the project in qt creator opens cmd waiting for a key to terminate the process with return value 0.
    when i do not include the libs and include paths many errors occure while compiling the project : "undefined reference" to the opencv functions.
    so it seems as qt finds the libs but although it does not work.
    my path : C:\QtSDK\mingw\bin; C:\QtSDK\QtCreator\bin; C:\OpenCV\debug\bin; C:\OpenCV\debug\include; C:\OpenCV\debug\lib.
    in C:\OpenCV\debug\ the libs end with .dll.a.
    i tried backslashes instead of forward slashes, to include without quotes and i moved the libs from D: to C: and back, started the Qt creator and the exe as admin but it does not change the behaviour of the project/.exe.
    my fellow student has exactly the same OS (Windows 7 64 bit) the same folders where openCV is found and the same PATH and on his destkop it works.

  • Moderators

    Qt finds the libraries for linking (.a or .lib) but when you double click .exe, it requires the to be available in system path or in the same directory as the executable.

    Also, for LIBS variable, I think you should specify all libraries explicitly by name.

  • welcome to devnet

    You should stick with forward slashes for Qt and in this case qmake. AFAIK you have to reference each used lib independently and cannot use wild cards there.
    Any way if your fellow student has the exact same configuration and .pro file it should work the same way. Check the pro files and also if the lib names are identical in both configurations.
    If this is the case run qmake again on your project.

  • but running the process in qt creator does not give the expected result. the process terminates without open the webcam or image that it should do and do on my fellow students pc. and he uses the same way to embedd the libs

  • but how can i embedd more than one library independently, i tried it so many ways but the .exe only finds the first library in try to include. i tried it with -L and backslashes at the end of each line to use multiply lines...we try to solve this problem since 4 hours ..

  • solved the problem. i just reinstalled qt creator and now it works ...

Log in to reply