Qt 没有这样的文件或目录
我即将完成从Qt 4.x到5的项目迁移,但是.pro文件给了我很多错误:Qt 没有这样的文件或目录,qt,path,filenotfoundexception,project-files,Qt,Path,Filenotfoundexception,Project Files,我即将完成从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:/min
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
当我对那些包含-lwhat的行进行注释时,我从下面的其他行中得到相同的错误,在
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
可能是什么?我确实有文件夹生成文件和发布,所以我不知道是什么问题。
另外,我也不太明白。/../../../和。/,如果有人能给我解释一下,也许我能更容易地理解这个问题
编辑:这里有更多的错误,我得到的时候,我来的-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
解释
开关的使用与GCC套件的手册不一致。()
链接器搜索库的标准目录列表,实际上是一个名为liblibrary.a的文件。然后,链接器使用该文件,就好像它是按名称精确指定的一样
搜索的目录包括多个标准系统目录以及使用-L指定的任何目录
-l
开关后应仅显示名称/文件名
还请注意,如果指定名称而不是文件名(带扩展名),链接器将查找lib.(a | so | dll)
文件
qxmpp的示例:
您指定了-L“qxmpp-0.3.0/lib”
,它将qxmpp-0.3.0/lib
目录(位于当前项目目录中)添加到查找库时要分析的目录列表中。然后-lqxmpp
指示链接器在目录列表中查找名为libqxmpp.a
的文件
解决
因此,您必须检查每个未找到的库:有一个
-L
指令指向库所在的正确目录(通常/
将引用项目的根目录,以及./
其父目录等),并检查在-l
指令中调用的库名称是否正确(完整文件名或缩写名)。/
表示当前目录:因此/GeneratedFiles
是执行脚本的目录GeneratedFiles
。每个。/
表示一个级别的upPerfect!我马上去看看。只有一件事,DEPENDPATH+=/和类似的东西呢,他们给出了错误,但与Library无关。我从来没有处理过这个问题。我对所有给出问题的行进行了注释,并将include()移到了应用程序的顶部。我现在犯了更多的错误,但这是一个进步。