首页| 论坛| 消息

回复: 我快要崩溃了,关于静态编译的问题
#11 [XChinux 04-15 23:47]
Linux那就写shell脚本吧。
#12 [sinl 04-15 23:51]
脚本不行,我的安装程序只能有一个文件,而且以前的QT3是可以静态编译链接的,我想QT4一定可以,只是我们没找到方法
#13 [XChinux 04-16 13:15]
Qt 4.1.2静态编译安装成功了,但写程序的时候静态链接时出错,libfontconfig等地方出错。写程序动态链接的话没问题。
config.status文件
#!/bin/sh
if [ "$#" -gt 0 ]; then
/home/redflag/backup/qt-x11-opensource-src-4.1.2/configure -static -release -no-qt3support -fast -confirm-license "$@"
else
/home/redflag/backup/qt-x11-opensource-src-4.1.2/configure -static -release -no-qt3support -fast -confirm-license
fi
~
我不知道如果把for X11的那些选项去掉不知道可以不。大多数都是默认的选择了,如果不选择,不知道上面的链接会不会出问题。
Qt/X11 only:
*-no-nas-sound ...... Do not compile in NAS sound support.
-system-nas-sound .. Use NAS libaudio from the operating system.
See http://radscan.com/nas.html
-no-sm ............. Do not support X Session Management.
*-sm ................ Support X Session Management, links in -lSM -lICE.
-no-xshape ......... Do not compile XShape support.
*-xshape ............ Compile XShape support.
Requires X11/extensions/shape.h.
-no-xinerama ....... Do not compile Xinerama (multihead) support.
*-xinerama .......... Compile Xinerama support.
Requires X11/extensions/Xinerama.h and libXinerama.
-no-xcursor ........ Do not compile Xcursor support.
*-xcursor ........... Compile Xcursor support.
Requires X11/Xcursor/Xcursor.h and libXcursor.
-no-xrandr ......... Do not compile Xrandr (resize and rotate) support.
*-xrandr ............ Compile Xrandr support.
Requires X11/extensions/Xrandr.h and libXrandr.
-no-xrender ........ Do not compile Xrender support.
*-xrender ........... Compile Xrender..
#14 [XChinux 04-16 13:17]
静态链接安装时QT好大啊,670M,而且还是没有debug library的。
而动态链接安装,包括debug library才340M,如果没有debug library则只有76M
静态release安装和动态release安装相差近10倍。
#15 [sinl 04-16 22:08]
是的,静态链接的时候是会报libfontconfig错误
什么一堆函数未定义
所有的选项都是可以去掉的,我尝试过,但是你去掉以后很多东西不能使用,比如拖拽(-xshape 选项)还有字体配置,但是即使你全加上默认选项还是不能解决中文问题,我现在最担心的就是QT使用了插件模型来解决国际化问题,这样的话静态编译就比较复杂了。
而且用designer 写界面的时候,中文无法输入,全是乱码,在源文件里面添加中文也不行,
比如tr("测试")或者 QString::fromLocal8Bit("测试"),显示出来的都是乱码

<< 1 2 3 >> (3/3)

回复 发表
主题 版块