【发布时间】:2012-02-25 01:45:18
【问题描述】:
我已经为 MinGW 下载了最新的 Qt 版本,并且我拥有与 Qt 兼容的正确 MinGW 版本。当我尝试制作项目时,即使它与项目文件位于同一文件夹中,g++ 也无法找到我的源文件。
这些是我遵循的步骤(所有项目和源文件都在 T:\QtTest 中):
T:\QtTest> qmake -project
T:\QtTest> qmake
T:\QtTest> make
输出是这样的:
T:\QtTest> make
mingw32-make -f Makefile.Debug
mingw32-make1: Entering directory `T:/QtTest’
g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I“c:\Qt\4.8.0\include\QtCore” -I“c:\Qt\4.8.0\include\QtGui” -I“c:\Qt\4.8.0\include” -I”.” -I“c:\Qt\4.8.0\include\ActiveQt” -I“debug” -I“c:\Qt\4.8.0\mkspecs\default” -o debug\main.o main.cpp
g++: main.cpp: no such file or directory
g++: no input files
mingw32-make1: *** [debug/main.o] Error 1
mingw32-make1: Leaving directory `T:/QtTest’
mingw32-make: *** [debug] Error 2
我不知道为什么它与“main.cpp”文件位于同一目录中时找不到 项目文件。即使我用完整路径(“T:\QtTest\main.cpp”)替换“main.cpp”,它仍然找不到它。我做错了什么?
以下是我的项目结构: (main.cpp是我写的唯一文件,其他都是qmake生成的)
T:\QtTest\main.cpp
T:\QtTest\Makefile
T:\QtTest\Makefile.debug
T:\QtTest\Makefile.release
T:\QtTest\QtTest.pro
T:\QtTest\debug\
T:\QtTest\release\
我的 g++ 版本是 4.4.0,这是 Qt 安装程序建议的版本,可在与 Qt for MinGW 安装程序相同的页面下载。
【问题讨论】:
-
@FernandoAiresCastello:您可能想要发布项目文件。和 t:\qttest 的目录列表。此外,您可能还想提及 g++ 版本。