我的程序无法启动,抱怨需要 libgcc_s_sjlj-1.dll。但是,该文件在 Qt 目录中不存在。我做了一些搜索,发现应该添加 -static-libgcc 和 -static-libstdc++ 。所以这是我的 .pro 文件:
QT += core gui xml
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = mouseEventProcess
TEMPLATE = app
SOURCES += main.cpp\
mainwindow.cpp \
fileOp.cpp \
xmlpraser.cpp \
pixmapOp.cpp \
mathOp.cpp
HEADERS += mainwindow.h \
fileOp.h \
xmlpraser.h \
pixmapOp.h \
mathOp.h
FORMS += mainwindow.ui
#COMPILE LIBGCC_S_SJLJ-1.DLL AND LIBSTDC++-6.DLL INTO THE EXE FILE
win32{
QMAKE_LFLAGS += -static-libgcc
QMAKE_LFLAGS += -static-libstdc++
#BOOST LIBRARIES. CHANGE TO YOUR OWN.
INCLUDEPATH += D:/boost_1_51_0
#OPENCV LIBRARIES. CHANGE TO YOUR OWN.
INCLUDEPATH += D:/opencv2.4.4/include
INCLUDEPATH += D:/opencv2.4.4/release/install/include
LIBS += -LD:/opencv2.4.4/release/install/lib \
-lopencv_core244 \
-lopencv_highgui244 \
-lopencv_imgproc244
#-lopencv_features2d244 \
#-lopencv_calib3d244
}
unix{
#BOOST LIBRARIES. CHANGE TO YOUR OWN.
INCLUDEPATH += /home/panda/boost_1_51_0
#OPENCV LIBRARIES.IF YOU COMPILED AND INSALLED
#OPENCV FROM CMAKE & MINGW, JUST LEAVE IT BE,
#UNLESS YOU KNOW EXACTLY WHAT YOU ARE DOING.
INCLUDEPATH += /usr/local/include/opencv
INCLUDEPATH += /usr/local/include/opencv2
LIBS += -lopencv_core -lopencv_imgproc -lopencv_highgui
LIBS += -lopencv_ml -lopencv_video -lopencv_features2d
LIBS += -lopencv_calib3d -lopencv_objdetect -lopencv_contrib
LIBS += -lopencv_legacy -lopencv_flann
}
如果可行,则不需要 libgcc_s_sjlj-1.dll 和 libstdc++-6.dll。但是,在我将它放入 .exe 文件夹之前,该程序仍然需要 libstdc++-6.dll。
所以我的问题是:我在哪里可以获得 libgcc_s_sjlj-1.dll 或者我的 .pro 文件有什么问题?