阅读:2133回复:3
求程序运行时找不到共享库问题解决方法(200分)
在ARM-LINUX下运行程序,总是提示如下错误:
error while loading shared libraries: cannot open shared object file. 不会像RED HAT LINUX下一样提示找不到哪些库. 现在我现在RED HAT LINUX编译运行并通过ldd找到所有的库,在ARM-LINUX查看发现所有库都有,但就是运行时出现上述错误. 在/lib目录下的库如下: /lib # ls -l -rwxr-xr-x 1 root root 1519 Sep 25 2004 crt1.o -rwxr-xr-x 1 root root 2112 Sep 25 2004 crti.o -rwxr-xr-x 1 root root 1752 Sep 25 2004 crtn.o -rwxr-xr-x 1 root root 1848 Sep 25 2004 gcrt1.o -rwxr-xr-x 1 root root 482523 Sep 25 2004 ld-2.2.3.so -rwxr-xr-x 1 root root 104352 Sep 25 2004 ld-2.2.5.so -rwxr-xr-x 1 root root 482523 Sep 25 2004 ld-linux.so.2 drwxr-xr-x 2 root root 1024 Sep 25 2004 ldscripts -rwxr-xr-x 1 root root 12020 Sep 25 2004 libanl.a -rwxr-xr-x 1 root root 12490 Sep 25 2004 libanl_p.a -rwxr-xr-x 1 root root 210 Sep 25 2004 libc.so -rwxr-xr-x 1 root root 4864934 Sep 25 2004 libc.so.6 -rwxr-xr-x 1 root root 6260 Sep 25 2004 libc_nonshared.a -rwxr-xr-x 1 root root 74801 Sep 25 2004 libdl-2.2.3.so -rwxr-xr-x 1 root root 726 Sep 25 2004 libg.a -rwxr-xr-x 1 root root 38301 Sep 25 2004 libgcc_s.so -rwxr-xr-x 1 root root 38301 Sep 25 2004 libgcc_s.so.1 -rwxr-xr-x 1 root root 9155 Sep 25 2004 libpcprofile.so -rwxr-xr-x 1 root root 481235 Sep 25 2004 libpthread-0.9.so -rwxr-xr-x 1 root root 117804 Sep 25 2004 libpthread.a -rwxr-xr-x 1 root root 481235 Sep 25 2004 libpthread.so.0 -rwxr-xr-x 1 root root 122102 Sep 25 2004 libpthread_p.a -rwxr-xr-x 1 root root 35366 Sep 25 2004 librt-2.2.5.so -rwxr-xr-x 1 root root 48466 Sep 25 2004 librt.a -rwxr-xr-x 1 root root 35366 Sep 25 2004 librt.so -rwxr-xr-x 1 root root 35366 Sep 25 2004 librt.so.1 -rwxr-xr-x 1 root root 50240 Sep 25 2004 librt_p.a -rwxr-xr-x 1 root root 25946 Sep 25 2004 libthread_db-1.0.so -rwxr-xr-x 1 root root 25946 Sep 25 2004 libthread_db.so -rwxr-xr-x 1 root root 25946 Sep 25 2004 libthread_db.so.1 -rwxr-xr-x 1 root root 13437 Sep 25 2004 libutil-2.2.5.so -rwxr-xr-x 1 root root 13437 Sep 25 2004 libutil.so -rwxr-xr-x 1 root root 13437 Sep 25 2004 libutil.so.1 |
|
|
沙发#
发布于:2004-09-29 09:47
Linux 上的dynamic link lib是通过/etc/ld.conf去查找的,看一下需要的目录是不是在这个文件中都有。
|
|
板凳#
发布于:2004-09-30 17:16
建议重新安装ARMGcc。
|
|
地板#
发布于:2004-10-01 22:32
现在对lpthread动态连接编译成功了,但静态连接失败.
lpthread编译选项如下: /usr/local/arm/2.95.3/bin/arm-linux-gcc -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -static -I /usr/local/arm/2.95.3/arm-linux/include -L /usr/local/arm/2.95.3/arm-linux/lib -lpthread -lc -o testthread testthread.c 错误信息如下: [root@localhost testthread]# make /usr/local/arm/2.95.3/bin/arm-linux-gcc -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -static -I /usr/local/arm/2.95.3/arm-linux/include -L /usr/local/arm/2.95.3/arm-linux/lib -lpthread -lc -o testthread1 testthread1.c /tmp/ccVNTGTB.o: In function `main': /tmp/ccVNTGTB.o(.text+0x44): undefined reference to `pthread_create' /tmp/ccVNTGTB.o(.text+0x58): undefined reference to `pthread_join' collect2: ld returned 1 exit status make: *** [testthread1] Error 1 请各位不吝赐教 已知/usr/local/arm/2.95.3/arm-linux/lib目录下存在libpthread.a和libpthread.so |
|
|