【发布时间】:2012-11-18 16:52:06
【问题描述】:
我已经在Windows 8 Pro x64、Qt Creator 2.6.0 和MingW 4.4.0 上手动安装了适用于Windows 的Qt Open source 4.8.3 库。从 Qt Creator 我设置了工具包和编译器。我打开了 Qt Creator 附带的模拟时钟示例并重建了项目。编译器发出以下错误。
Running steps for project analogclock...
Starting: "C:\Qt\4.8.3\bin\qmake.exe" C:\Qt\4.8.3\examples\widgets\analogclock\analogclock.pro -r -spec win32-g++
The process "C:\Qt\4.8.3\bin\qmake.exe" exited normally.
Starting: "C:\MingW\bin\mingw32-make.exe"
C:/MingW/bin/mingw32-make -f Makefile.Release
mingw32-make[1]: Entering directory `C:/Qt/4.8.3/examples/widgets/analogclock-build-Desktop-Release'
g++ -c -O2 -Wall -Wextra -fno-exceptions -fno-rtti -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -DQT_NO_DYNAMIC_CAST -I"..\..\..\include\QtCore" -I"..\..\..\include\QtGui" -I"..\..\..\include" -I"..\..\..\include\ActiveQt" -I"release" -I"..\analogclock" -I"." -I"..\..\..\mkspecs\win32-g++" -o release\analogclock.o **..\analogclock\analogclock.cpp**
mingw32-make[1]: Leaving directory `C:/Qt/4.8.3/examples/widgets/analogclock-build-Desktop-Release'
mingw32-make[1]: *** [release/analogclock.o] Error 1
mingw32-make: *** [release] Error 2
The process "C:\MingW\bin\mingw32-make.exe" exited with code 2.
Error while building/deploying project analogclock (target: Desktop)
When executing step 'Make'
我已验证 C:/Qt/4.8.3/examples/widgets/analogclock/analogclock.cpp 存在。另外,这个项目是自带Qt安装的,我没有做任何改动。
为什么会出现这个错误,我该如何解决?
【问题讨论】:
-
您是否尝试过自己运行
g++ ...命令并查看它给您带来的错误?看起来 make 没有给你任何有用的东西。 -
输出目录(即
release目录)是否存在于预期位置? -
@Xymotech:当我尝试运行 g++ 时,我收到系统错误提示“找不到 libgmp-3.dll”。我搜索了 MinwG 并找到了 libgmp-10.dll。我想我需要安装旧版本的 libgmp?
-
确保 mingw bin 目录在您的路径中。这至少应该处理“libgmp-3.dll”错误。
-
您是否安装了发行版的 Qt 库?无论如何,尝试构建
analogclock的Debug版本。