Reputation: 3066
My project needs opencv library 2.3 and I'm using Qt 5.0.1. However, after building, the program won't start. I tried the Dependency Walker and added all Qt's dlls from C:\Qt\Qt5.0.1\5.0.1\mingw47_32\bin except libgcc_s_dw2-2.dll, which I couldn't find in my computer. The Dependency Walker says that libgcc_s_dw2-1.dll is needed by some opencv dlls such as libopencv_core230.dll. I tried the dll provided here, but got an error about the program couldn't locate the input entrance __gxx_personality_v0 on libopencv_imgproc230.dll. Any advices? :)
I've added the statement
QMAKE_LFLAGS += -static -static-libgcc -static-libstdc++ -lpthread
into .pro file, not work :(
Upvotes: 0
Views: 2935
Reputation: 3066
Finally, get it work.
The statement above is wrong since -lpthread is 'no use'. I changed it to this one:
QMAKE_LFLAGS += -static-libgcc -static-libstdc++
It seems that -lpthread should be used with -static next to it, ie. -static -lpthread. However, this will cause another problem that the compiler can't find opencv libs. So I just remove them and add libpthread-1.dll to the .exe folder.
Many thanks to this post.
Upvotes: 1