|
 |
栏目导栏 |
|
| |
|
|
|
|
 |
资料搜索 |
|
| |
|
|
|
|
 |
热门文章 |
|
| |
|
|
|
|
 |
最新文章 |
|
| |
|
|
|
| |
| |
|
|
|
|
[ 作者: 加入时间:2006-12-14 11:33:13 来自:linux-ren.org
] | |
|
一、编译安装:6W6Linux联盟 6W6Linux联盟 ./configure --release -plugin-sql-mysql -plugin-sql-sqlite -plugin-sql-odbc -plugin-sql-psql6W6Linux联盟 6W6Linux联盟 但是在运行的时候,它会可能会提示你测试不到mysql或pgsql函数6W6Linux联盟 于是,要增加/etc/profile环境6W6Linux联盟 6W6Linux联盟 LD_LIBRARY_PATH=/usr/local/pgsql/lib:/usr/local/mysql/lib/mysql6W6Linux联盟 6W6Linux联盟 要修改一下configure后Qt4源码的src/plugins/sqldrivers/mysql/mysql.pro在最开始处,加上下面两行(具体的目录,需要你自己查看系统的实际位置6W6Linux联盟 6W6Linux联盟 INCLUDEPATH += /usr/local/mysql/include/mysql6W6Linux联盟 LIBS += -L/usr/local/mysql/lib/mysql6W6Linux联盟 6W6Linux联盟 pgsql则类似以上修改src/plugins/sqldrivers/mysql/mysql.pro6W6Linux联盟 6W6Linux联盟 INCLUDEPATH+=/usr/local/pgsql/include /usr/local/pgsql/include/server /usr/local/pgsql/include/internal6W6Linux联盟 LIBS += -L/usr/local/pgsql/lib6W6Linux联盟 6W6Linux联盟 如果数据库如本教程是安装在/usr下,那么应该是这样:6W6Linux联盟 6W6Linux联盟 INCLUDEPATH+=/usr/include/postgresql/server /usr/include/postgresql/internal /usr/include/postgresql/informix6W6Linux联盟 LIBS += -L/usr/lib/postgresql6W6Linux联盟 6W6Linux联盟 然后运行6W6Linux联盟 ./configure --release -plugin-sql-mysql -plugin-sql-sqlite -plugin-sql-odbc -plugin-sql-psql -continue6W6Linux联盟 make6W6Linux联盟 make install6W6Linux联盟 6W6Linux联盟 可能发现插件仍未被安装,进入src/plugins/sqldrivers/mysql,进行make;make install,其它数据库插件类似。6W6Linux联盟 6W6Linux联盟 在编译QT的时候,如果在 ./configure的时候没有加任何参数的话,QT4默认编译release和debug两个版本,因此编译时间特别长,./configure 上加上 --release 参数. 这样只编译一份release的,可以省下一半以上的时间。 6W6Linux联盟 6W6Linux联盟 二、编程环境的设置:6W6Linux联盟 6W6Linux联盟 编译安装非常费时,可以直接安装现成的rpm包,everest工具盘有提供,也可以到以下地址下载安装包6W6Linux联盟 6W6Linux联盟 ftp://linux-ren.org/uploads/haulm/Qt-4.26W6Linux联盟 6W6Linux联盟 6W6Linux联盟 为了避免主用户(经常编译程序的用户)在编译软件时遇到使用的Qt3.x和Qt4学习环境相混淆,最好是新建一个专门的用户来学习Qt4编程。6W6Linux联盟 6W6Linux联盟 新建用户并登录,然后需要在我们的shell配置文件里增加几行,bash配置文件为.bash_profile:6W6Linux联盟 6W6Linux联盟 执行kwrite ~/.bash_profile6W6Linux联盟 6W6Linux联盟 添加如下内容:6W6Linux联盟 6W6Linux联盟 PATH=/usr/lib/qt4/bin:$PATH6W6Linux联盟 export PATH6W6Linux联盟 QTDIR=/usr/lib/qt4/6W6Linux联盟 export QTDIR6W6Linux联盟 6W6Linux联盟 执行以下命令:6W6Linux联盟 6W6Linux联盟 cd /usr/bin6W6Linux联盟 6W6Linux联盟 ln -s /usr/lib/qt4/bin/qmake qmake46W6Linux联盟 6W6Linux联盟 ln -s /usr/lib/qt4/bin/designer designer46W6Linux联盟 6W6Linux联盟 ln -s /usr/lib/qt4/bin/assistant assistant46W6Linux联盟 6W6Linux联盟 当然,以后如果使用了KDE4桌面就不会有这等麻烦事。6W6Linux联盟 6W6Linux联盟 运行/usr/lib/qt4/bin/qtconfig,在Font项将字体设置为Bitstream Charter退出,避免assistant4帮助文档粗体字破碎。 来源:http://www.linux-ren.org/modules/newbb/viewtopic.php?topic_id=2214&forum=15
Linux联盟收集整理 ,转贴请标明原始链接,如有任何疑问欢迎来本站Linux论坛讨论 |
|
|
|
|
|