页面
0
Posted on 星期日, 四月 26, 2009 by 随想~ and filed under
Qt
个人认为只需要加个 -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-<>尖括号里包含上面的样式。
0
Posted on 星期六, 四月 25, 2009 by 随想~ and filed under
Qt
昨天晚上开始下载的 qt4.5.1 opensource 源码包,今天一觉睡到11点,下午还有选修课。晕死了!晚上回来在网上看了看windows vista +Vs2008下安装Qt教程,基本了解了安装过程了。
好的开始安装。
- 添加一个系统变量 path d:\qt\4.5.1\bin\,不然编译后命令行里面是运行不起qmake的,她会提示你没有定义该命令之类的。具体添加方法,系统属性|高级设置|系统变量|修改PATH,在后面添加;D:\qt\4.5.1\bin\前面的分号是隔开前一个目录的所以必须添加。
- 解压下载下来的源码包到D:\Qt\,它的文件名是qt-win-opensource-src-4.5.1,咱改个短点的名字就4.5.1了,好qtsdk的根路径就是D:\Qt\4.5.1\了,qt文档里说明了这个路径不能有空格符。
- 接下来是打开vs2008命令提示符,开始|所有程序|Microsoft Visual Studio 2008|Visual Studio Tools|Visual Studio 2008命令提示,网上很多文章说要手动设置vs2008的环境变量,其实不需要,因为打开这个命令提示窗口系统就自动设置好了vs2008环境了。
Setting environment for using Microsoft Visual Studio 2008 x86 tools.
所以直接切换到qtsdk根目录也就是cd D:\Qt\4.5.1\
- 输入configure -fast -no-stl -static 回车,就是漫长的配置makefiles过程。-fast参数表示只编译库和库目录下的东西,而不包括像doc,demo,等 -no-stl表示不添加标准库支持,因为vs2008已经有stl了, -static 是静态编译,不动态链接库。我这里没有指定QMAKESPEC 参数,如果知道这个参数(win32-msvc2008)就可以指定或者你机器上安装了多个编译环境的话,最好指定这个标识符,但是我不知道我的参数是什么,所以没有指定它,后面configure会自动侦测已安装的编译环境自动指定该标识符。 具体参数详见这里,
- configure结束后 程序会提示你运行nmake来编译qt,既然她提示你运行nmake,当然就运行nmake了,时间很长。
- 如果nmake过程没出什么错误的话OK,咱的Qt安装成功了。完成后我的D盘就只剩下1G的空间了,整个4.5.1文件夹用了大约9G的空间,nmake clean 过后该文件夹用了1.5G左右的空间。
我编译过程中蓝屏一次,不知道是不是由于编译引起的。没办法重启后nmake clean ,然后重新configure一下,再nmake一下。
不要试着用古老的vc6.0来配置qt4了,qt4开始不支持vc6.0了以及vs2003以前版本了。
先休息下!
0
就在大约两周前,Qt labs blog 曾说they are working hard on QtCreator 1.1qtcreator1.1.0RC版本已经出来了,没想到这么快,今天NOKIA就发布了最新的Qt 4.5.1 、QtCreator 1.1.0。当然还有我期待的VS add-in 1.0也跳出RC正式发布了!(感叹他们的效率)
QtCreator 1.0 问题多多,这是命中注定的。
QtCreator 1.1 由于它的版本是1.1,我的直觉来看,这个版本要比1.0成熟不少
这里要说个有趣的现象那就是 子版本是 1的比起子版本是0的要成熟很多,拿windows来举例:
- windows 3.0 vs 3.1
- windows 4.0(win95)vs 4.1(win98)
- windowsNT 5.0(win2000) vs 5.1(winXp)
- windows 6.0(vista)vs 6.1(win7) .
呵呵看出来了没,所以我从直觉来看1.1版比起1.0是好了很多。
我学习Qt从没自己编译过源代码,可能是自己比较懒吧!但是直接用现成的东西给人很笨很傻瓜的感觉,那些能自己编译源代码的我感觉很牛X,虽然不是真的很牛X。下载下来写个程序先!学编程还是要多写!
