我正在尝试运行 Xalan C++ 库提供的示例可执行文件,它需要 Xerces C 库。但是我无法正确链接 Xerces 共享对象文件。
mike@ubuntu:~/Xalan-C_1_9_0-redhat_80-gcc_32/bin$ ldd SimpleXPathAPI
linux-gate.so.1 => (0xf7765000)
libxalan-c.so.19 => /home/mike/Xalan-C_1_9_0-redhat_80-gcc_32/lib/libxalan-c.so.19 (0xf7409000)
libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xf73ab000)
libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xf738e000)
libxerces-c.so.26 => not found
libxalanMsg.so.19 => /home/mike/Xalan-C_1_9_0-redhat_80-gcc_32/lib/libxalanMsg.so.19 (0xf7386000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf71d8000)
/lib/ld-linux.so.2 (0xf7768000)
libstdc++.so.5 => not found
libxerces-c.so.26 => not found
我在我的 LD_LIBRARY_PATH
中包含了包含 libxerces-c.so
的位置,但是 ldd
找不到它。
mike@ubuntu:~/Xalan-C_1_9_0-redhat_80-gcc_32/bin$ echo $LD_LIBRARY_PATH
/home/mike/Xalan-C_1_9_0-redhat_80-gcc_32/lib:/usr/local/lib
我什至添加了一个软链接(soft link)以确保包含 .26
。
mike@ubuntu:/usr/local/lib$ ls -l
total 98308
-rwxr-xr-x 1 root root 25560971 Aug 28 13:39 libxerces-c-3.1.so
-rw-r--r-- 1 root root 75080734 Aug 28 13:39 libxerces-c.a
-rwxr-xr-x 1 root root 962 Aug 28 13:39 libxerces-c.la
lrwxrwxrwx 1 root root 18 Aug 28 13:39 libxerces-c.so -> libxerces-c-3.1.so
lrwxrwxrwx 1 root root 14 Oct 21 10:31 libxerces-c.so.26 -> libxerces-c.so
drwxr-xr-x 2 root root 4096 Aug 28 13:39 pkgconfig
drwxrwsr-x 4 root staff 4096 Feb 18 2015 python2.7
drwxrwsr-x 3 root staff 4096 Feb 18 2015 python3.4
drwxr-xr-x 3 root root 4096 Jul 6 15:42 site_ruby
我第一次遇到 => not found
问题 libxalan-c.so.19
我通过将该文件的位置添加到我的 来解决它>LD_LIBRARY_PATH
。所以我无法弄清楚为什么相同的修复程序对 libxerces-c.so.26
不起作用。有谁知道我做错了什么?
最佳答案
这会产生什么:
cd /usr/local/lib
file -L ./libxerces-c.so.26
很有可能,这将打印类似 ELF 64-bit LSB shared object ...
的内容,在这种情况下,您试图将 32 位可执行文件指向 64 位库,并且 那行不通。
您需要下载 32 位版本的 libxerces
。
关于c++ - ldd 未找到 xerces 的共享对象 (.so),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33265778/