vs2005 QT4.7.1编译 详细
http://blog.csdn.net/debugconsole/article/details/8230683
网上一搜有QT+2005编译的很多文章,但是都不详细,很多都编不过,特别的在configure 命令的时候会有 File or path is not found <nmake>提示。这说明系统没找到VS nmake.exe路径 。
以下是详细步骤:
一:下载安装VS2005 这里不详细说明
二:下载QT源码包,这里是Qt4.71(qt-everywhere-opensource-src-4.7.1.tar.gz)
三:解压QT源码包到C盘 这里路径为 c:\qt\qt4.7.1-2005\
四:配置环境变量: path中增加 c:\qt\qt4.7.1-2005\bin
创建系统环境变量QMAKESPEC值为 win32-msvc2005,这个值还是根据你要生成的Vs版本,6.0 使用win32-msvc, 2003 使用win32-msvc.net, 2005就是 win32-msvc2005
创建 QTDIR值为 c:\qt\qt4.7.1-2005\
五:从VC 2005的安装路径找到vsvars32.bat(以你自己的安装目录为准,我的是D:/Program Files/Microsoft Visual Studio 8/Common7/Tools)
vsvars32.bat 批处理命令用来在当前进程注册VS环境变量。
六:运行CMD
C:/> D:
C:/>cd D:/Program Files/Microsoft Visual Studio 8/Common7/Tools
D:/>Program Files/Microsoft Visual Studio 8/Common7/Tools> vsvars32.bat
D:/> cd c:\qt\qt4.7.1-2005\
C:/qt/qt4.7.1-2005>configure -debug-and-release -stl -platform win32-msvc2005 -no-dsp –vcproj (参数说明见下文)
提示1: Type 'c' if you want to use the Commercial Edition.
Type 'o' if you want to use the Open Source Edittion.
根据情况选择c或者o
> nmake
等待数小时后(视机器条件而定),编译成功即可;
七:下载并安装VS2005的QT插件:qt-vs-addin(qt-vs-addin-1.1.8.exe)
八:配置 VS2005 环境
启动 VS2005;
选择菜单: “ Tools ” -〉 “ Options ” ;
在弹出窗口中,选择 左边 的数状列表中的 “QT” -> “Builds”, 在右边新增一个变量:
+--------------+-----------------------------------------------+
| Name | Path |
+--------------+-----------------------------------------------+
| qt4.7.1 | C:/qt/qt4.7.1-2005 |
+--------------+-----------------------------------------------+
如果安装Visual Assist的话,需要配置一下,才有代码提示功能.
"VAssistX" -> "Visual Assist X Options ..." -> "Projects", 在"Platform"里面把"Win32"改为"Custom",
在"Stable include files"末尾添加"c:/qt/qt4.7.1-2005/include".
至此,环境设置完成;
编译时参数说明:
configure
-debug-and-release
参数的意义是告诉QT同时编译为Debug和Release两个版本的库,不指定参数则编译为Debug版本的动态链接库如果安装了多个版本的VS可以加
上-platform win32-msvc2005(表示VS2005的),6.0 使用win32-msvc, 2003
使用win32-msvc.net, 2008就是 win32-msvc2008。configure大约需要几分钟,-nomake
examples -nomake
demos就是不编译例子,值钱我介绍的把这两个目录移走的方法不太好。但是按我的这个configure变异的话,会有问题的,编译不通过,因为我的这
是完全编译,我编译了3次才过的,每次到编译webkit的时候就出错,据说这是Qt4.5的bug,但是我从网上找到了解决办法,就是在
configure之后先不要nmake,删除c:/qt/qt4.7.1-2005/src/3rdparty/webkit/WebCore/tmp
/moc/debug_shared/mocinclude.tmp文件和
c:/qt/qt4.7.1-2005/src/3rdparty/webkit/WebCore/tmp/moc/release_shared/mocinclude.tmp文件,然后再namke吧,一定成功得,呵呵~
下面是我从网上搜索到的configure的具体参数,供大家编译参考:
个人认为只需要加个 -fast参数就ok了。其他参数视自己情况而定,比如你不需要qt3支持可以添加-no-qt3support,或者不需要webkit插件 -no-webkit
配置参数选项:
前面是*号的表示默认参数. +号表示该功能要求被评估,评估成功后才能被接受.
-release ........... 调试关闭.没有调试库,自己的项目只能发布,不能调试(没有调试库的缘故),如果你硬要编译debug版本的话,会提示找不到xxxxxd.dll
* -debug ............. 只有调试库,没有释放库,也就是说以后自己的项目只能调试,如果你硬要编译debug版本的话,会提示找不到xxxxx.dll
+ -debug-and-release . 编译后包含两种库。最好编译两种库
-opensource ........ 编译开源版.
-commercial ........ 编译商业版. 这两个参数一般不需指定,configure开始需要你选择版本。
-developer-build ... 编译开发者选项。
* -shared ............动态编译.
-static ............ 静态链接库.貌似有插件不能用静态编译。
* -no-fast ........... configure生成所有项目makefiles文件,并编译
-fast .............. 只生成库目录及子目录下的项目的makefiles文件.
-no-exceptions ..... 关闭异常支持
* -exceptions ........ 开启异常支持.
-no-accessibility .. 关闭对windows active控件支持.
* -accessibility .....对windows active控件支持.
-no-stl ............ 无c++标准库支持
* -stl ............... 有标准库支持
尖括号在blogger出问题了。。。。。
-no-sql- ... Disable SQL entirely, by default none are turned on.
-qt-sql- ... Enable a SQL in the Qt Library.
-plugin-sql- Enable SQL as a plugin to be linked to at runtime.
Available values for :
mysql
psql
oci
odbc
tds
db2
+ sqlite
sqlite2
ibase
(drivers marked with a '+' have been detected as available on this system)
-system-sqlite ..... Use sqlite from the operating system.
-no-qt3support ..... 不提供对qt3函数支持
-no-opengl ......... 不提供OpenGL函数支持
-platform ... The operating system and compiler you are building on.
(default %QMAKESPEC%)
-xplatform .. The operating system and compiler you are cross compiling to.
See the README file for a list of supported operating systems and compilers.
-qtnamespace Wraps all Qt library code in 'namespace name {...}
-D ........ Add an explicit define to the preprocessor.
-I ... Add an explicit include path.
-L ... Add an explicit library path.
-l ... Add an explicit library name, residing in a librarypath.
-graphicssystem Specify which graphicssystem should be used.
Available values for :
* raster - Software rasterizer
opengl - Using OpenGL accelleration, experimental!
-help, -h, -? ...... Display this information.
第三方库
-qt-zlib ........... 使用zlib绑定到qt.
+ -system-zlib ....... 使用操作系统的zlib
见 http://www.gzip.org/zlib
-no-gif ............ 不编译gif文件读取支持插件
+ -qt-gif ............ 编译gif文件读取支持插件
参见 src/plugins/imageformats/gif/qgifhandler.h
-no-libpng ......... 不编译PNG支持插件.
-qt-libpng ......... 编译PNG支持插件.
+ -system-libpng ..... 使用系统libpng库
见 http://www.libpng.org/pub/png
-no-libmng ......... 不编译MNG支持插件.
-qt-libmng ......... 编译MNG支持插件.
+ -system-libmng ..... 使用系统的mng库
参见 http://www.libmng.com
-no-libtiff ........ 不编译tiff支持插件.
-qt-libtiff ........ 编译tiff支持插件.
+ -system-libtiff .... 使用系统的libtiff库
见 http://www.libtiff.org
-no-libjpeg ........ 不编译jpeg支持插件库
-qt-libjpeg ........ 编译jpeg支持插件库
+ -system-libjpeg .... 使用系统的jpeg支持库
见 http://www.ijg.org
以下参数仅对qt for windows有效
-no-dsp ............ 不生成 VC++ .dsp 文档.
* -dsp ...............生成 VC++ .dsp文档, 需要有平台标识符"win32-msvc".注意 qt4开始就不支持vc6.0了所以这两个参数无效。
-no-vcproj ......... 不生成 VC++ .vcproj 文档
* -vcproj ............ 生成 VC++ .vcproj 文档, 需要平台标识符"win32-msvc.net".也就是vs2003以上的编译环境
-no-incredibuild-xge Do not add IncrediBuild XGE distribution commands to custom build steps.
+ -incredibuild-xge .. Add IncrediBuild XGE distribution commands to
custom build steps. This will distribute MOC and UIC steps, and other
custom buildsteps which are added to the INCREDIBUILD_XGE variable.
(The IncrediBuild distribution commands are only added to Visual Studio projects)
-no-plugin-manifests 插件不嵌入manifests.
* -plugin-manifests .. 插件嵌入manifests.
-no-qmake .......... 不编译qmake
* -qmake ............. 编译 qmake. 不建议 不编译qmake
-dont-process ...... 不生成makefiles和project文档. 比 -no-fast 参数优先级更高
* -process ........... 生成makefiles和project文档.
-no-rtti ........... 不编译运行时类型信息。
* -rtti .............. 编译运行时类型信息。
//下面是对指令的支持,不解释了
-no-mmx ............ Do not compile with use of MMX instructions
+ -mmx ............... Compile with use of MMX instructions
-no-3dnow .......... Do not compile
with use of 3DNOW instructions
+ -3dnow ............. Compile with use of 3DNOW instructions
-no-sse ............ Do not compile with use of SSE instructions
+ -sse ............... Compile with use of SSE instructions
-no-sse2 ........... Do not compile with use of SSE2 instructions
+ -sse2 .............. Compile with use of SSE2 instructions
+ -direct3d .......... 将Direct3D支持编译进来。检测不到direct3d sdk 就不支持
-no-openssl ........ Do not compile in OpenSSL support
+ -openssl ........... Compile in run-time OpenSSL support
-openssl-linked .... Compile in linked OpenSSL support
-no-dbus ........... Do not compile in D-Bus support
+ -dbus .............. Compile in D-Bus support and load libdbus-1 dynamically
-dbus-linked ....... Compile in D-Bus support and link to libdbus-1
-no-phonon ......... 不将 Phonon 模块 编译进来
+ -phonon ............ 将 Phonon 模块编译进来 (若使用的规范的c++编译器则会自动编译Phonon模块)
-no-phonon-backend . Do not compile the platform-specific Phonon backend-plu
gin
* -phonon-backend .... Compile in the platform-specific Phonon backend-plugin
-no-webkit ......... 不将webkit模块编译进来,编译webkit非常耗时间。
+ -webkit ............ 将webkit模块编译进来 (若使用的规范的c++编译器则会自动编译WebKit模块)
-no-scripttools .... Do not build the QtScriptTools module.
* -scripttools ....... Build the QtScriptTools module.
-arch ....... 外观样式.
有以下几种 :
* windows
windowsce
boundschecker
generic
-no-style-尖括号里包含上面的样式。
vs2005 QT4.7.1编译 详细的更多相关文章
- CentOS6-Linux内核编译 详细步骤
CentOS6-Linux内核编译 详细步骤 背景 Win10用VMwareWorkstation搭的虚拟机 CentOS6.5,内核版本2.6.32-431.el6.x86_64 在该环境下升级至4 ...
- Qt与VS2005/2008的完美配合(自己编译Qt4.5.1的详细步骤)
介绍 用过Linux的人想必都知道Qt(不是QuickTime,呵呵)这个名称,KDE就是用Qt写的,我也是接触Linux后才认识它的. Qt原先是奇趣科技TM(Trolltech)的产品,由Haav ...
- Qt4.85静态编译配置VS动态编译(非常详细的图文教程)
http://www.qter.org/forum.php?mod=viewthread&tid=1409&extra=page%3D1&page=1
- QT-4.8.6 编译配置过程
1.编译 TSLib sudo apt-get install automake autogen libtool libtool-bin./autogen.sh./configure --host=a ...
- 解析Qt4.7.3编译MySql数据库驱动,存中文乱码、过滤转义字符问题
问题:使用QSqlDataBase类建立连接MySql数据库驱动加载失败 QSqlDatabase: QMYSQL driver not loaded QSqlDatabase: available ...
- Windows下QT4.8.4编译环境的搭建(转载http://blog.csdn.net/bestgonghuibin/article/details/38933141)
开始使用QT了,所以第一步就是把环境搭起来,这里小记一下,以免以后忘记. 1. 下载安装文件 要使用QT功能,那么必须要下载QT的源码,还必须要一个是用QT的编译环境,可以是VS2010,也可以是专用 ...
- Qt入门之基础篇(三):掌握Qt4的静态编译基本方法
转载载请注明出处:CN_Simo. 导语: 前两章都提到过“静态编译”(Static Compilation),在Windows下一次静态编译差不多需要长达三个小时才能完成,而且还非常容易由于各种原因 ...
- ubuntu下Android反编译详细教程-apktool,dex2jar,jd-gui的使用
转载请注明出处:http://blog.csdn.net/fightlei/article/details/52432161 最近在学习Android反编译的一些知识,虽然在网上搜到了很多相关的文章, ...
- WebRTC编译详细介绍 (转)
WebRTC技术交流群:234795279 原文地址:http://blog.csdn.net/temotemo/article/details/7056581 WebRTC编译 本人环境: 操作 ...
随机推荐
- FreeRTOS ------ 栈、堆、任务栈
1.任务的栈资源(创建任务分配的资源,单位是4字节)来自 configTOTAL_HEAP_SIZE 定义的堆,如果任务栈总量超过 configTOTAL_HEAP_SIZE,任务创建失败: 2.如果 ...
- Linux查看内核和系统版本
1. 查看内核版本命令: 1) [root@q1test01 ~]# cat /proc/version Linux version 2.6.9-22.ELsmp (bhcompile@crowe.d ...
- http-反向代理学习
主要是学习了反向代理. 结合公司的方向代理使用,然后与同事进行交流,知识还是需要通过交流才能印象深刻,以后多多交流.
- Xamarin入门浅析
1. 安装 1) 使用标准安装流程(JDK1.6 -> Android SDK -> NDK -> Xamarin Studio -> Xamarin Visual Studi ...
- 【bzoj1774-过路费】floyd+排序
题意:n个点,m条双向边,每个点有权值c[i],每条边有权值a[i].d,一条路径的费用=每条边的权值和+各个点的权值的最大值,即sigma(a[i].d)+max(c[i]).q个询问,问x到y的最 ...
- bzoj 1036: [ZJOI2008]树的统计Count——树链剖分
Description 一棵树上有n个节点,编号分别为1到n,每个节点都有一个权值w.我们将以下面的形式来要求你对这棵树完成一些操作: I. CHANGE u t : 把结点u的权值改为t II. Q ...
- 【POJ】2947 Widget Factory(高斯消元)
http://poj.org/problem?id=2947 各种逗啊..还好1a了.. 题意我就不说了,百度一大把. 转换为mod的方程组,即 (x[1,1]*a[1])+(x[1,2]*a[2]) ...
- python初步学习-python控制流
语句书写规范 缩进在python语言书写中非常重要,如果缩进不规范,执行程序将会报错 引用维基百科中的叙述: Python開發者有意讓違反了縮排規則的程序不能通過編譯,以此來強迫程序員養成良好的編程習 ...
- bufferd对象详解
使用buffer类处理二进制数据 在客户端javascript脚本代码中,对于二进制数据并没有提供一个很好的支持.然后在nodejs中需要处理像TCP流或文件流时,必须要处理二进制数据.因此在node ...
- 大话Spring Cloud
研究了一段时间Spring Boot了准备向Spring Cloud进发,公司架构和项目也全面拥抱了Spring Cloud.在使用了一段时间后发现Spring Cloud从技术架构上降低了对大型系统 ...