高人指点一下,qt静态链接的问题!!!!!!!!
请求高人指点
我希望编译完全静态链接没有依赖的程序
我开始是用qt sdk开发的
后来静态编译安装了qt-x11-opensource-src-4.5.2
使用qmake 和make之后编译的程序ldd查看没有qt的库依赖了
而系统库与c++库还是动态链接的
网上查阅资料后
我在makefile之中的LIBS 后加上-static
但是却无法编译成功 make后提示一大串
(.text+0x1380): undefined reference to `pcre_compile2'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libglib-2.0.a(gregex.o): In function `g_regex_new':
(.text+0x13a9): undefined reference to `pcre_fullinfo'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libglib-2.0.a(gregex.o): In function `g_regex_new':
(.text+0x140d): undefined reference to `pcre_study'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libglib-2.0.a(gregex.o): In function `g_regex_new':
(.text+0x14ef): undefined reference to `pcre_config'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libglib-2.0.a(gregex.o): In function `g_regex_new':
(.text+0x1506): undefined reference to `pcre_config'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libglib-2.0.a(gregex.o): In function `g_regex_new':
(.text+0x154a): undefined reference to `pcre_fullinfo'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libglib-2.0.a(gregex.o): In function `get_matched_substring_number':
(.text+0x1b60): undefined reference to `pcre_get_stringtable_entries'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libglib-2.0.a(gregex.o): In function `get_matched_substring_number':
(.text+0x1bdb): undefined reference to `pcre_get_stringnumber'
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/libglib-2.0.a(gregex.o): In function `g_match_info_next':
(.text+0x20e5): undefined reference to `pcre_exec'
collect2: ld 返回 1
make: *** [complexdialog] 错误 1
ldd的效果
linux-gate.so.1 => (0xb7fd9000)
libpng12.so.0 => /usr/lib/libpng12.so.0 (0xb7f98000)
libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0xb7f21000)
libgobject-2.0.so.0 => /usr/lib/libgobject-2.0.so.0 (0xb7ee2000)
libSM.so.6 => /usr/lib/libSM.so.6 (0xb7ed9000)
libICE.so.6 => /usr/lib/libICE.so.6 (0xb7ec1000)
libXrender.so.1 => /usr/lib/libXrender.so.1 (0xb7eb7000)
libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0xb7e8a000)
libXext.so.6 => /usr/lib/libXext.so.6 (0xb7e7a000)
libX11.so.6 => /usr/lib/libX11.so.6 (0xb7d8a000)
libz.so.1 => /lib/libz.so.1 (0xb7d74000)
libgthread-2.0.so.0 => /usr/lib/libgthread-2.0.so.0 (0xb7d6e000)
librt.so.1 => /lib/tls/i686/cmov/librt.so.1 (0xb7d65000)
libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0xb7cad000)
libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0xb7ca9000)
libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0xb7c8f000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb7ba0000)
libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb7b7a000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb7b6b000)
libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7a08000)
libpcre.so.3 => /lib/libpcre.so.3 (0xb79d5000)
libuuid.so.1 => /lib/libuuid.so.1 (0xb79d0000)
libexpat.so.1 => /usr/lib/libexpat.so.1 (0xb79a9000)
libXau.so.6 => /usr/lib/libXau.so.6 (0xb79a5000)
libxcb.so.1 => /usr/lib/libxcb.so.1 (0xb798b000)
/lib/ld-linux.so.2 (0xb7fda000)
libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0xb7985000)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不懂,关注。