简体   繁体   中英

QtCreator and OpenCV

I managed to compile successfuly programs that use OpenCV with QtCreator but i have a problem with the dlls when i try to execute my application.

在此处输入图片说明

This is the error i get. The wierd thing is that i don't have this dll in my system. I tried to download it and place it in the same directory with the executable but i get the same error.

here is my .pro file

LIBS += -Lc:/Users/Libraries/OpenCV2.3/build/x86/mingw/bin/

LIBS += -lopencv_calib3d230 \
        -lopencv_contrib230\
        -lopencv_core230 \
        -lopencv_features2d230 \
        -lopencv_flann230 \
        -lopencv_gpu230 \
        -lopencv_highgui230 \
        -lopencv_imgproc230 \
        -lopencv_legacy230 \
        -lopencv_ml230 \
        -lopencv_objdetect230 \
        -lopencv_video230

INCLUDEPATH += c:/Users/Libraries/OpenCV2.3/build/include/

SOURCES += \
    main.cpp

Anyone that knows why this problem occurs?

I found what was going wrong. I compiled opencv again and changed my .pro file to link from that folder.

Linking with the opencv-superpack package that is provided for windows caused this problem.

I hope this will help others facing the same problem.

Did you try, instead of simply putting the dll in the folder to add it to the path of your system ?

On win XP it's something like: Configuration Panel > System > Advanced > Paths

Downloading a versioned DLL probably won't work. libstdc++-6.dll should be in the bin directory of your MinGW installation (which was probably included with QtCreator, check there).

You must distribute this dll with your app (or link with -static ) or at least add its directory to PATH.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM