? QT编译过程会使用比较大的硬盘空间,大约占有5-6G。
??? 1.先安装好vs2010,然后去qt网站上下载qt-everywhere-opensource-src-4.7.4.zip 解压到相应
??? 磁盘目录(我的是E:),然后发现有个叫qt-everywhere-opensource-src-4.7.4的文件夹,修改
??? 文件夹名字为qt,此时我的qt安装根目录是e:qt
?
在开始栏中找到visual studio的工具visual studio命令提示符(2010)。我编译机器是32位的
??? 所以,就只用最下面那个visual studio命令提示符(2010)。双击该程序
??? 试着?? cd e:qt
??? 在e:qt下输入? configure -platform win32-msvc2010
?????????????????? -debug-and-release -nomake examples -nomake demos
?????????????????? 后根据提示按o(开源协议),y(开始)
?????????????????? 等待configure完成。
(mingw编译去掉-platform参数,configure以后用mingw32-make编译)
??
??????????????????
??? 说明:你可以输入configure -help事先查看说明
????????
??????????????????? -prefix 指定的就是安装目录
??????????????????? -platform 选择编译平台
??????????????????? -shared -static? 就是选择编译静态版
??????????????????? -debug-and-release 编译目标 这个是 debug 和 release都编译
??????????????????? -no-qt3support 虽然新开发QT的不会使用到QT3,一般情况下还是选上吧,因为难
??????????????????? 免有些需要编译的QT工具需要它。
??????????????????? 其它的选项就是选择编译什么QT安装包
??????????????????? -nomake examples -nomake docs -nomake demos 就是是不是编译文档 和 例子,
??????????????????? 编译例子的时间很长,一般可以不编译。
??????????????????
??????????????????? 如果编译过程需要使用第三方的包,可以用 -I 和-L 来增加。
??? 3.运行完configure后运行nmake
?
上面这段是剽窃的http://blog.csdn.net/lw5566001/article/details/6877874大家可以去学习一下
?
本人在经历第一步时就出了差错,错误时这样的

?
说环境中缺少个Perl,Perl这东西自己去维基上看Perl维基百科
?
现在是如何解决问题的时候,他缺啥,咱就给他补上呗,Perl官网下载链接?或者我的资源下载链接?各位看过这文章的,不介意给我一份的可以点我的资源进去下,我当然乐意笑纳啦。
?
然后按上面那儿仁兄的办法编译,出现了那位仁兄所述的第一种情况的出现
?
1)编译大概1个小时之后,出现:
??????????????????? 01.api/qscriptextensionplugin.h(43): Error: Undefined interface
??????????????????? 02.NMAKE : fatal error U1077: 'C:/Qt/2009.05/qt/bin/moc.exe' : return code
?????????????????????? '0x1'
??????????????????? 03.Stop.
??????????????????? 04.NMAKE : fatal error U1077: '"d:/Program Files/Microsoft Visual Studio
?????????????????????? 9.0/VC/BIN
??????????????????? 05./nmake.exe"' : return code '0x2'
??????????????????? 06.Stop.
??????????????????? 07.NMAKE : fatal error U1077: 'cd' : return code '0x2'
??????????????????? 08.Stop.
??????????????????? api/qscriptextensionplugin.h(43): Error: Undefined interface
??????????????????? NMAKE : fatal error U1077: 'C:/Qt/2009.05/qt/bin/moc.exe' : return code
??????????????????? '0x1' Stop.
??????????????????? NMAKE : fatal error U1077: '"d:/Program Files/Microsoft Visual Studio 9.0
??????????????????? /VC/BIN
??????????????????? /nmake.exe"' : return code '0x2'
??????????????????? Stop.
??????????????????? NMAKE : fatal error U1077: 'cd' : return code '0x2'
??????????????????? Stop.
??????????????????? 以上是出错代码,解决方法是将
??????????????????? qt/src/script/tmp/moc/debug_shared/mocinclude.tmp
??????????????????? qt/src/script/tmp/moc/release_shared/mocinclude.tmp
??????????????????? 删除,然后继续编译。输入nmake即可。
?
该问题经本人鉴定有效。
?
?
然后我又碰到个问题,忘了截图了,大概的信息是这样的
DefaultLocalizationStrategy.cpp(327) : “error C2001: newline in constant” in building 4.8.0
解决办法就是打开Control panel? ->Clock,Language,and Region ->Region and Language选择Administrative选项卡,把language for non-Unicode programs下的内容改成English(United States)。我的是英文版win7
重启电脑以后,问题应该就没有了
?
?
http://qt-project.org/forums/viewthread/13632