您尚未登录。

#1 2013-10-04 22:37:13

荒野无灯
荒野无灯
注册时间: 2012-12-02
帖子: 36
个人网站

解决启动wiznote时undefined symbol: FcitxXDGGetFileUserWithPrefix错误

解决启动wiznote时/usr/lib/libfcitx-qt.so.0: undefined symbol: FcitxXDGGetFileUserWithPrefix错误

前面还运行得好好的,今天突然打不开了。

启动时报错:

└─[$] <> wiznote

wiznote: symbol lookup error: /usr/lib/libfcitx-qt.so.0: undefined symbol: FcitxXDGGetFileUserWithPrefix

但是在编译目录( ~/build/WizQTClient-build ) 下执行:

./bin/wiznote 却能顺利运行程序。



默认在加载时链接到 /usr/lib/libQ* ,看来问题出在这。得让wiznote默认用~/build/WizQTClient-build/lib下的qt4动态链接库文件,而不是 /usr/lib/libQ*



用vim任意打开~/build/WizQTClient-build下的一个文件,然后搜索 ../lib

:vimgrep /\.\.\/lib/ */**/*

很快定位到了:

~/build/WizQTClient-build/WizQTClient-build/src/CMakeFiles/wiznote.dir/link.txt

这个文件。




直接修改行末的 -lpthread -Wl,-rpath,"\$ORIGIN/../lib"为:

-lpthread -Wl,-rpath,"\$ORIGIN/../lib/wiznote"


接着开始复制链接需要的文件,由于程序默认安装后bin文件是在/usr/local/bin/wiznote

因此,链接库的位置相应的为/usr/local/lib/wiznote




复制Qt4库文件:

┌─[admin@HuangYe] - [/usr/local/lib/wiznote] - [Fri Oct 04, 07:17]

└─[$] <> cp -Rv ~/build/WizQTClient-build/lib/libQt* .




┌─[admin@HuangYe] - [/usr/local/lib/wiznote] - [Fri Oct 04, 07:47]

└─[$] <> ls

libpng16.so.16      libQtCore.so.4  libQtNetwork.so.4  libQtXmlPatterns.so.4

libpng16.so.16.2.0  libQtGui.so.4   libQtWebKit.so.4   libQtXml.so.4


还有就是libpng的问题,前面是采用降级 libpng的方法处理的。这里顺便把它也复制过来,然后我们就可以放心升级libpng了。

查看下链接文件:

┌─[admin@HuangYe] - [/usr/local/lib/wiznote] - [Fri Oct 04, 07:19]

└─[$] <> ldd /usr/local/bin/wiznote| grep png

	libpng16.so.16 => /usr/lib/libpng16.so.16 (0xb40b0000)




┌─[admin@HuangYe] - [/usr/local/lib/wiznote] - [Fri Oct 04, 07:21]

└─[$] <> ll /usr/lib/libpng16.so.16

lrwxrwxrwx 1 root root 18 May  6 17:25 /usr/lib/libpng16.so.16 -> libpng16.so.16.2.0*

复制过来:

┌─[admin@HuangYe] - [/usr/local/lib/wiznote] - [Fri Oct 04, 07:23]

└─[$] <> sudo cp -v /usr/lib/libpng16.so.16 .                               

‘/usr/lib/libpng16.so.16’ -> ‘./libpng16.so.16’


好了,就这7个文件:

┌─[admin@HuangYe] - [/usr/local/lib/wiznote] - [Fri Oct 04, 07:50]

└─[$] <> ls

libpng16.so.16  libQtGui.so.4      libQtWebKit.so.4       libQtXml.so.4

libQtCore.so.4  libQtNetwork.so.4  libQtXmlPatterns.so.4


在编译目录下同样创建一份:

┌─[admin@HuangYe] - [~/build/WizQTClient-build/lib] - [Fri Oct 04, 07:20]

└─[$] <> mkdir wiznote




┌─[admin@HuangYe] - [~/build/WizQTClient-build/lib] - [Fri Oct 04, 07:20]

└─[$] <> cp libQt* wiznote 

┌─[admin@HuangYe] - [~/build/WizQTClient-build/lib] - [Fri Oct 04, 07:20]

└─[$] <> ls wiznote 

libQtCore.so.4  libQtNetwork.so.4  libQtXmlPatterns.so.4

libQtGui.so.4   libQtWebKit.so.4   libQtXml.so.4




┌─[admin@HuangYe] - [~/build/WizQTClient-build/lib/wiznote] - [Fri Oct 04, 07:51]

└─[$] <> cp /usr/local/lib/wiznote/libpng16.so.16 .




┌─[admin@HuangYe] - [~/build/WizQTClient-build/lib/wiznote] - [Fri Oct 04, 07:53]

└─[$] <> ls

libpng16.so.16  libQtGui.so.4      libQtWebKit.so.4       libQtXml.so.4

libQtCore.so.4  libQtNetwork.so.4  libQtXmlPatterns.so.4




~/build/WizQTClient-build

rm ./bin/wiznote

然后我们接着重新链接:

┌─[admin@HuangYe] - [~/build/WizQTClient-build] - [Fri Oct 04, 07:43]


└─[$] <> make

[ 25%] Built target clucene-core-static

[ 47%] Built target cryptlib

[ 50%] Built target clucene-shared-static

Linking CXX executable ../bin/wiznote

[100%] Built target wiznote

查看下链接情况:

┌─[admin@HuangYe] - [~/build/WizQTClient-build] - [Fri Oct 04, 07:53]

└─[$] <> ldd ./bin/wiznote           

	linux-gate.so.1 (0xb773f000)

	libQtWebKit.so.4 => /home/admin/build/WizQTClient-build/bin/../lib/wiznote/libQtWebKit.so.4 (0xb57d7000)

	libQtXmlPatterns.so.4 => /home/admin/build/WizQTClient-build/bin/../lib/wiznote/libQtXmlPatterns.so.4 (0xb53eb000)

	libQtGui.so.4 => /home/admin/build/WizQTClient-build/bin/../lib/wiznote/libQtGui.so.4 (0xb4941000)

	libQtXml.so.4 => /home/admin/build/WizQTClient-build/bin/../lib/wiznote/libQtXml.so.4 (0xb48ff000)

	libQtNetwork.so.4 => /home/admin/build/WizQTClient-build/bin/../lib/wiznote/libQtNetwork.so.4 (0xb47bf000)

	libQtCore.so.4 => /home/admin/build/WizQTClient-build/bin/../lib/wiznote/libQtCore.so.4 (0xb44db000)

	libdl.so.2 => /usr/lib/libdl.so.2 (0xb44a8000)

	libpthread.so.0 => /usr/lib/libpthread.so.0 (0xb448c000)

	libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb43a3000)

	libm.so.6 => /usr/lib/libm.so.6 (0xb435c000)

	libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0xb4340000)

	libc.so.6 => /usr/lib/libc.so.6 (0xb4190000)

	libz.so.1 => /usr/lib/libz.so.1 (0xb4179000)

	libXrender.so.1 => /usr/lib/libXrender.so.1 (0xb416e000)

	libjpeg.so.8 => /usr/lib/libjpeg.so.8 (0xb4113000)

	libpng16.so.16 => /home/admin/build/WizQTClient-build/bin/../lib/wiznote/libpng16.so.16 (0xb40d9000)

	libudev.so.1 => /usr/lib/libudev.so.1 (0xb40c6000)

	libgstapp-0.10.so.0 => /usr/lib/libgstapp-0.10.so.0 (0xb40b9000)

	libgstinterfaces-0.10.so.0 => /usr/lib/libgstinterfaces-0.10.so.0 (0xb40a8000)

	libgstpbutils-0.10.so.0 => /usr/lib/libgstpbutils-0.10.so.0 (0xb4085000)

	libgstvideo-0.10.so.0 => /usr/lib/libgstvideo-0.10.so.0 (0xb4066000)

	libgstbase-0.10.so.0 => /usr/lib/libgstbase-0.10.so.0 (0xb4005000)

	libgstreamer-0.10.so.0 => /usr/lib/libgstreamer-0.10.so.0 (0xb3f1c000)

	libgobject-2.0.so.0 => /usr/lib/libgobject-2.0.so.0 (0xb3ecd000)

	libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0xb3dcb000)

	libsqlite3.so.0 => /usr/lib/libsqlite3.so.0 (0xb3d12000)

	libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0xb3cd7000)

	libQtOpenGL.so.4 => /usr/lib/libQtOpenGL.so.4 (0xb3bdb000)

	libGL.so.1 => /usr/lib/libGL.so.1 (0xb3b82000)

	libX11.so.6 => /usr/lib/libX11.so.6 (0xb3a4b000)

	libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0xb39ab000)

	libSM.so.6 => /usr/lib/libSM.so.6 (0xb39a2000)

	libICE.so.6 => /usr/lib/libICE.so.6 (0xb3988000)

	libXext.so.6 => /usr/lib/libXext.so.6 (0xb3975000)

	libssl.so.1.0.0 => /usr/lib/libssl.so.1.0.0 (0xb3910000)

	libcrypto.so.1.0.0 => /usr/lib/libcrypto.so.1.0.0 (0xb3749000)

	librt.so.1 => /usr/lib/librt.so.1 (0xb3740000)

	/lib/ld-linux.so.2 (0xb7740000)

	libgmodule-2.0.so.0 => /usr/lib/libgmodule-2.0.so.0 (0xb373b000)

	libxml2.so.2 => /usr/lib/libxml2.so.2 (0xb35e1000)

	libgthread-2.0.so.0 => /usr/lib/libgthread-2.0.so.0 (0xb35de000)

	liborc-0.4.so.0 => /usr/lib/liborc-0.4.so.0 (0xb354c000)

	libpcre.so.1 => /usr/lib/libpcre.so.1 (0xb34df000)

	libffi.so.6 => /usr/lib/libffi.so.6 (0xb34d8000)

	libexpat.so.1 => /usr/lib/libexpat.so.1 (0xb34af000)

	libglapi.so.0 => /usr/lib/libglapi.so.0 (0xb3497000)

	libXdamage.so.1 => /usr/lib/libXdamage.so.1 (0xb3493000)

	libXfixes.so.3 => /usr/lib/libXfixes.so.3 (0xb348d000)

	libX11-xcb.so.1 => /usr/lib/libX11-xcb.so.1 (0xb348a000)

	libxcb-glx.so.0 => /usr/lib/libxcb-glx.so.0 (0xb3471000)

	libxcb-dri2.so.0 => /usr/lib/libxcb-dri2.so.0 (0xb346a000)

	libxcb.so.1 => /usr/lib/libxcb.so.1 (0xb3448000)

	libXxf86vm.so.1 => /usr/lib/libXxf86vm.so.1 (0xb3442000)

	libdrm.so.2 => /usr/lib/libdrm.so.2 (0xb3436000)

	libbz2.so.1.0 => /usr/lib/libbz2.so.1.0 (0xb3426000)

	libuuid.so.1 => /usr/lib/libuuid.so.1 (0xb341f000)

	liblzma.so.5 => /usr/lib/liblzma.so.5 (0xb33f8000)

	libXau.so.6 => /usr/lib/libXau.so.6 (0xb33f4000)

	libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0xb33ed000)


从上面的结果可以看到已经按我们所要求的,qt4库链接到了../lib/wiznote




安装


┌─[admin@HuangYe] - [~/build/WizQTClient-build] - [Fri Oct 04, 07:43]

└─[$] <> sudo make install

[sudo] password for admin: 

[ 25%] Built target clucene-core-static

[ 47%] Built target cryptlib

[ 50%] Built target clucene-shared-static

[100%] Built target wiznote

Install the project...

-- Install configuration: "Release"

-- Installing: /usr/local/bin/wiznote

......

-- Up-to-date: /usr/local/share/icons/hicolor/256x256/apps/wiznote.png

┌─[admin@HuangYe] - [~/build/WizQTClient-build] - [Fri Oct 04, 07:43]

由于前面已经安装过了,因此这里实际上只重新安装了 /usr/local/bin/wiznote 文件。




查看下libpng的链接情况:

┌─[admin@HuangYe] - [~/build/WizQTClient-build/src/CMakeFiles/wiznote.dir] - [Fri Oct 04, 07:44]

└─[$] <> ldd /usr/local/bin/wiznote | grep png

	libpng16.so.16 => /usr/local/bin/../lib/wiznote/libpng16.so.16 (0xb40a1000)

再检查下:

┌─[admin@HuangYe] - [/usr/local/lib/wiznote] - [Fri Oct 04, 07:50]

└─[$] <> ldd /usr/local/bin/wiznote 

	linux-gate.so.1 (0xb76f5000)

	libQtWebKit.so.4 => /usr/local/bin/../lib/wiznote/libQtWebKit.so.4 (0xb578d000)

	libQtXmlPatterns.so.4 => /usr/local/bin/../lib/wiznote/libQtXmlPatterns.so.4 (0xb53a1000)

	libQtGui.so.4 => /usr/local/bin/../lib/wiznote/libQtGui.so.4 (0xb48f7000)

	libQtXml.so.4 => /usr/local/bin/../lib/wiznote/libQtXml.so.4 (0xb48b5000)

	libQtNetwork.so.4 => /usr/local/bin/../lib/wiznote/libQtNetwork.so.4 (0xb4775000)

	libQtCore.so.4 => /usr/local/bin/../lib/wiznote/libQtCore.so.4 (0xb4491000)

	libdl.so.2 => /usr/lib/libdl.so.2 (0xb445e000)

	libpthread.so.0 => /usr/lib/libpthread.so.0 (0xb4442000)

	libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb4359000)

	libm.so.6 => /usr/lib/libm.so.6 (0xb4312000)

	libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0xb42f6000)

	libc.so.6 => /usr/lib/libc.so.6 (0xb4146000)

	libz.so.1 => /usr/lib/libz.so.1 (0xb412f000)

	libXrender.so.1 => /usr/lib/libXrender.so.1 (0xb4124000)

	libjpeg.so.8 => /usr/lib/libjpeg.so.8 (0xb40c9000)

	libpng16.so.16 => /usr/local/bin/../lib/wiznote/libpng16.so.16 (0xb408f000)

	libudev.so.1 => /usr/lib/libudev.so.1 (0xb407c000)

	libgstapp-0.10.so.0 => /usr/lib/libgstapp-0.10.so.0 (0xb406f000)

	libgstinterfaces-0.10.so.0 => /usr/lib/libgstinterfaces-0.10.so.0 (0xb405e000)

	libgstpbutils-0.10.so.0 => /usr/lib/libgstpbutils-0.10.so.0 (0xb403b000)

	libgstvideo-0.10.so.0 => /usr/lib/libgstvideo-0.10.so.0 (0xb401c000)

	libgstbase-0.10.so.0 => /usr/lib/libgstbase-0.10.so.0 (0xb3fbb000)

	libgstreamer-0.10.so.0 => /usr/lib/libgstreamer-0.10.so.0 (0xb3ed2000)

	libgobject-2.0.so.0 => /usr/lib/libgobject-2.0.so.0 (0xb3e83000)

	libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0xb3d81000)

	libsqlite3.so.0 => /usr/lib/libsqlite3.so.0 (0xb3cc8000)

	libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0xb3c8d000)

	libQtOpenGL.so.4 => /usr/lib/libQtOpenGL.so.4 (0xb3b91000)

	libGL.so.1 => /usr/lib/libGL.so.1 (0xb3b38000)

	libX11.so.6 => /usr/lib/libX11.so.6 (0xb3a01000)

	libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0xb3961000)

	libSM.so.6 => /usr/lib/libSM.so.6 (0xb3958000)

	libICE.so.6 => /usr/lib/libICE.so.6 (0xb393e000)

	libXext.so.6 => /usr/lib/libXext.so.6 (0xb392b000)

	libssl.so.1.0.0 => /usr/lib/libssl.so.1.0.0 (0xb38c6000)

	libcrypto.so.1.0.0 => /usr/lib/libcrypto.so.1.0.0 (0xb36ff000)

	librt.so.1 => /usr/lib/librt.so.1 (0xb36f6000)

	/lib/ld-linux.so.2 (0xb76f6000)

	libgmodule-2.0.so.0 => /usr/lib/libgmodule-2.0.so.0 (0xb36f1000)

	libxml2.so.2 => /usr/lib/libxml2.so.2 (0xb3597000)

	libgthread-2.0.so.0 => /usr/lib/libgthread-2.0.so.0 (0xb3594000)

	liborc-0.4.so.0 => /usr/lib/liborc-0.4.so.0 (0xb3502000)

	libpcre.so.1 => /usr/lib/libpcre.so.1 (0xb3495000)

	libffi.so.6 => /usr/lib/libffi.so.6 (0xb348e000)

	libexpat.so.1 => /usr/lib/libexpat.so.1 (0xb3465000)

	libglapi.so.0 => /usr/lib/libglapi.so.0 (0xb344d000)

	libXdamage.so.1 => /usr/lib/libXdamage.so.1 (0xb3449000)

	libXfixes.so.3 => /usr/lib/libXfixes.so.3 (0xb3443000)

	libX11-xcb.so.1 => /usr/lib/libX11-xcb.so.1 (0xb3440000)

	libxcb-glx.so.0 => /usr/lib/libxcb-glx.so.0 (0xb3427000)

	libxcb-dri2.so.0 => /usr/lib/libxcb-dri2.so.0 (0xb3420000)

	libxcb.so.1 => /usr/lib/libxcb.so.1 (0xb33fe000)

	libXxf86vm.so.1 => /usr/lib/libXxf86vm.so.1 (0xb33f8000)

	libdrm.so.2 => /usr/lib/libdrm.so.2 (0xb33ec000)

	libbz2.so.1.0 => /usr/lib/libbz2.so.1.0 (0xb33dc000)

	libuuid.so.1 => /usr/lib/libuuid.so.1 (0xb33d5000)

	liblzma.so.5 => /usr/lib/liblzma.so.5 (0xb33ae000)

	libXau.so.6 => /usr/lib/libXau.so.6 (0xb33aa000)

	libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0xb33a3000)


好了,可以放心去除 pacman.conf中对libpng设置的IgnorePkg了:



┌─[admin@HuangYe] - [/etc] - [Fri Oct 04, 07:55]

└─[$] <> cat pacman.conf | grep -i ignorepkg

# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup

IgnorePkg   =libpng


直接注释掉。

然后 pacman -Syu 放心升级libpng吧。





再运行下,这次没有报 undefined symbol: FcitxXDGGetFileUserWithPrefix错误了,wiznote.

最近编辑记录 荒野无灯 (2013-10-04 22:38:12)

离线

页脚