我正在完成将项目从 Qt 4.x 迁移到 5,但是 .pro 文件给了我很多错误:
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot find -lHDP
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot find -l../../Qwt/qwt-5.2.0/lib/debug/qwt5
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot find -lqenc
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot find -lzlibwapi
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot find -lqextserialport
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot find -lqxmpp
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot find -ljson_lib
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot find -lSerialPort1
当我评论那些包含 -lWhatever 的行时,我从下面的其他行中得到相同的错误,在
MOC_DIR += ./GeneratedFiles/release
OBJECTS_DIR += release
UI_DIR += ./GeneratedFiles
RCC_DIR = GeneratedFiles
include(Swibz.pri)
这是完整的代码:
TEMPLATE = app
TARGET = Swibz
DESTDIR = ../Release
QT += core gui network webkit webkitwidgets xml opengl serialport
CONFIG += release
DEFINES += _WINDOWS QT_LARGEFILE_SUPPORT QT_XML_LIB QT_OPENGL_LIB QT_NETWORK_LIB QT_DLL QWT_DLL
INCLUDEPATH += ../../../SprintLib \
./GeneratedFiles \
./GeneratedFiles/release \
GeneratedFiles/release \
. \
./../../Qwt/qwt-5.2.0/src \
../../../QENC/QENC \
../../../zlib-1.2.5 \
../../../serial/qextserialport-1.2win-alpha \
../../../qxmpp-0.3.0/src \
../../../JSON \
../../../QtSerialPort/qtserialport/include
LIBS += -L"../../../SprintLib/release" \
-L"../../../QENC/release" \
-L"../../../zlib-1.2.5/contrib/vstudio/vc9/x86/ZlibDllRelease" \
-L"../../../serial/qextserialport-1.2win-alpha/Release" \
-L" qxmpp-0.3.0/lib" \
-L"../../../JSON/Release" \
-L"../../../QtSerialPort/qtserialport/src/serialport/release" \
-lopengl32 \
-lglu32 \
-lgdi32 \
-luser32 \
-lHDP \ #cannot find
-l../../Qwt/qwt-5.2.0/lib/debug/qwt5 \ #cannot find
-lqenc \ #cannot find
-lzlibwapi \ #cannot find
-lqextserialport \ #cannot find
-lsetupapi \
-lqxmpp \ #cannot find
-ljson_lib \ #cannot find
-lSerialPort1 #cannot find
DEPENDPATH += ./
MOC_DIR += ./GeneratedFiles/release #cannot find
OBJECTS_DIR += release #cannot find
UI_DIR += ./GeneratedFiles #cannot find
RCC_DIR = ./GeneratedFiles #cannot find
include(Swibz.pri) #cannot find
#win32:RC_FILE = ./Swibz.rc
TRANSLATIONS = ln_en.ts
TRANSLATIONS = ln_lv.ts
TRANSLATIONS = ln_lt.ts
TRANSLATIONS = ln_es.ts
CODECFORTR = UTF-8
会是什么呢?我确实有文件夹 GeneratedFiles 和 release,所以我不知道出了什么问题。另外,我不太明白./../../和./的含义,如果有人可以向我解释,也许我可以更容易地看到这个问题。
编辑:当我评论-lthingys时,我得到更多错误,这没有意义
g++: error: DEPENDPATH: No such file or directory
g++: error: MOC_DIR: No such file or directory
g++: error: +=: No such file or directory