楼主的意思是静态编译吧
平台:windows7 软件:qt4.6+qt creator 1.3 使用的安装包是 qt-sdk-win-opensource-2009.05.exe
问题描述:
(1)使用qt creator 生成工程,写好程序进行编译运行,在qt creator点击运行,程序能跑起来,没问题,可是我在工程目录下找到编译生成的程序双击运行时,提示缺少mingwm10.dll,无法运行。
(2) 按照
http://wiki.qtcentre.org/index.php?title=Building_static_Qt_on_Windows#MinGW 这个方法完成操作以后,使用qt creator 不能用debug,只能使用release选项,使用debug选项产生的错误提示是:collect2:ld returned 1 exit status 通过查找资料发现是缺少debug库
解决方案:
(1)编辑 C:\Qt\2009.05\qt\mkspecs\win32-g++\qmake.conf 文件 把 QMAKE_LFLAGS = -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc
改为:QMAKE_LFLAGS = -static -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc
(2)在开始菜单里找到Qt Command Prompt并运行,输入命令: configure -static -debug-and-release -no-exceptions
(3)上一条命令运行成功后再输入命令: mingw32-make sub-src
等1 ~3 小时可能就运行完了 完成后就ok了。。。