c++ - ldd 未找到 xerces 的共享对象 (.so)

标签 c++ shared-libraries xerces xalan ldd

我正在尝试运行 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/

相关文章:

C++线程还活着吗?

C++98/03 引用折叠和 cv 限定符

c++ - 我可以使用函数指针调用虚拟析构函数吗?

c++ - 名称查找不依赖于 VC++2008 Express 中的模板参数。这是一个错误吗?

Android 获取 JNI 库目录

c++ - 用于制作C++库的API宏

java - 在 Java 中解析 XML 模式并派生元数据

java - Xerces - XmlString 到 Dom 对象

xml - XSD 验证错误 : cos-all-limited. 1.2: 'all' 模型组必须出现在粒子中

python - 为什么 Python 找不到 sys.path 目录中的共享对象?