Dll 在Ubuntu EC2实例上找不到libdl.so

Dll 在Ubuntu EC2实例上找不到libdl.so,dll,amazon-ec2,ubuntu-12.04,Dll,Amazon Ec2,Ubuntu 12.04,我是Ubuntu新手,在AmazonEC2云上运行Ubuntu 我试图在Ubuntu框(i386和amd64)上编译cppunit,它将不会链接到libdl g++ -g -O2 -o .libs/DllPlugInTester DllPlugInTester.o CommandLineParser.o -ldl ../../src/cppunit/.libs/libcppunit.so -lm -Wl,--rpath -Wl,/home/ubuntu/cppunit/lib ../../s

我是Ubuntu新手,在AmazonEC2云上运行Ubuntu

我试图在Ubuntu框(
i386
amd64
)上编译
cppunit
,它将不会链接到
libdl

g++ -g -O2 -o .libs/DllPlugInTester DllPlugInTester.o CommandLineParser.o  -ldl ../../src/cppunit/.libs/libcppunit.so -lm  -Wl,--rpath -Wl,/home/ubuntu/cppunit/lib
../../src/cppunit/.libs/libcppunit.so: undefined reference to `dlsym'
../../src/cppunit/.libs/libcppunit.so: undefined reference to `dlopen'
../../src/cppunit/.libs/libcppunit.so: undefined reference to `dlclose'
现在我不理解as
libdl。因此
在以下位置存在且正确:

ubuntu@domU-12-31-39-0A-98-1A:~/cppunit$ ls /lib/i386-linux-gnu/libdl*
/lib/i386-linux-gnu/libdl-2.15.so  /lib/i386-linux-gnu/libdl.so.2
但是
whereis
什么都没有:

ubuntu@domU-12-31-39-0A-98-1A:~/cppunit$ whereis libdl
libdl:
libc6
已安装:

ubuntu@domU-12-31-39-0A-98-1A:~/cppunit$ sudo apt-get install libc6
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libc6 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
那么为什么我的构建找不到它呢

uname-r
3.2.0-25-virtual

Fedora上的“Normal”
where
如下所示:

[matt cppunit] whereis libdl
libdl: /lib/libdl.so /usr/lib/libdl.so /lib64/libdl.so /usr/lib64/libdl.so
有什么想法吗

编辑:My
/etc/ld.so.conf.d/*.conf
似乎很合理:

ubuntu@domU-12-31-39-0A-98-1A:~$ cat /etc/ld.so.conf.d/*.conf
/usr/lib/i386-linux-gnu/mesa
# Multiarch support
/lib/i386-linux-gnu
/usr/lib/i386-linux-gnu
/lib/i686-linux-gnu
/usr/lib/i686-linux-gnu
# libc default configuration
/usr/local/lib
# This directive teaches ldconfig to search in nosegneg subdirectories
# and cache the DSOs there with extra bit 1 set in their hwcap match
# fields. In Xen guest kernels, the vDSO tells the dynamic linker to
# search in nosegneg subdirectories and to match this extra hwcap bit
# in the ld.so.cache file.
hwcap 1 nosegneg

我在64位ubuntu,GCC4.6.3上也遇到了这个问题,我的直觉是链接库的排序。然而,同样的东西建立在32位的基础上。 我在link命令的末尾添加了-ldl,它被链接了,所以看起来像是某种链接器问题。
您还可以从shell中设置env var:LIBS=-ldl,它将被构建。

我在64位ubuntu gcc 4.6.3上也遇到过这个问题,我的直觉是链接库的顺序。然而,同样的东西建立在32位的基础上。 我在link命令的末尾添加了-ldl,它被链接了,所以看起来像是某种链接器问题。
您还可以从shell中设置env var:LIBS=-ldl,它将生成。

因为ld.so.conf是用于动态链接器,而不是用于汇编后链接器ld(1)。有人创建了此新路径,但没有更新链接器搜索的目录。libdl的/lib64或/usr/lib64中应该有一个链接,或者链接器搜索链接64位对象的路径之一


从我的观点来看,这(新路径)是各种Linux发行版在不完全了解后果或历史的情况下进行随机更改的另一个例子。

因为ld.so.conf用于动态链接器,而不是用于汇编后链接器ld(1)。有人创建了此新路径,但没有更新链接器搜索的目录。libdl的/lib64或/usr/lib64中应该有一个链接,或者链接器搜索链接64位对象的路径之一

这(新路径)是另一个例子,从我的观点来看,各种Linux发行版在没有完全了解后果或历史的情况下进行的随机更改。

这也正是我们发现的。很奇怪,它在32位工作,但不是64位。这也正是我们发现的。非常奇怪,它在32位工作,但不是64位。