只有下面这些,没有so文件好像就不认,依赖libevent的程序也就找不到libevent。
bash-3.2# ls -al /usr/lib | grep libevent
-rwxr-xr-x 1 root system 1594713 Aug 11 23:37 libevent-2.0.a
lrwxrwxrwx 1 root system 14 Aug 11 23:37 libevent.a -> libevent-2.0.a
-rwxr-xr-x 1 root system 892 Aug 11 23:37 libevent.la
-rwxr-xr-x 1 root system 1075363 Aug 11 23:37 libevent_core-2.0.a
lrwxrwxrwx 1 root system 19 Aug 11 23:37 libevent_core.a -> libevent_core-2.0.a
-rwxr-xr-x 1 root system 917 Aug 11 23:37 libevent_core.la
-rwxr-xr-x 1 root system 588220 Aug 11 23:37 libevent_extra-2.0.a
lrwxrwxrwx 1 root system 20 Aug 11 23:37 libevent_extra.a -> libevent_extra-2.0.a
-rwxr-xr-x 1 root system 922 Aug 11 23:37 libevent_extra.la
-rwxr-xr-x 1 root system 154935 Aug 11 23:37 libevent_openssl-2.0.a
lrwxrwxrwx 1 root system 22 Aug 11 23:37 libevent_openssl.a -> libevent_openssl-2.0.a
-rwxr-xr-x 1 root system 947 Aug 11 23:37 libevent_openssl.la
-rwxr-xr-x 1 root system 77876 Aug 11 23:37 libevent_pthreads-2.0.a
lrwxrwxrwx 1 root system 23 Aug 11 23:37 libevent_pthreads.a -> libevent_pthreads-2.0.a
-rwxr-xr-x 1 root system 937 Aug 11 23:37 libevent_pthreads.la
5 个解决方案
#1
你编译的是静态库,configure时候加个shared编译成动态库。
#2
configure加上shared:
./configure --prefix=/usr --enable-shared
.......
.......
checking size of pthread_t... 4
configure: creating ./config.status
config.status: creating libevent.pc
config.status: creating libevent_openssl.pc
config.status: creating libevent_pthreads.pc
config.status: creating Makefile
config.status: creating include/Makefile
config.status: creating test/Makefile
config.status: creating sample/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands
然后还是没有事生成so文件,感谢你的回复
#3
确认一下 configure的时候动态库的是否能支持, 在config.log里查找shared应该能找到类似的语句
checking whether the cc -qlanglvl=extc89 linker (/usr/bin/ld) supports shared libraries
有些版本的automake/autoconf生成的configure脚本在AIX 6.1上不支持动态库
checking whether the cc -qlanglvl=extc89 linker (/usr/bin/ld) supports shared libraries
有些版本的automake/autoconf生成的configure脚本在AIX 6.1上不支持动态库
#4
楼主可以看一下config.guess文件里有没有这样的内容
*:AIX:*:[45]
*:AIX:*:[45]
#5
什么版本?
我用2.0.16-stable没有问题啊
亲自实验了一下。确实没有.so 但是用ar -t 可以看到.a里是有.so的, 所以是可以正常使用的。
$ ar -t libevent-2.0.a
libevent-2.0.so.5
大家有所不知的是在AIX下.a不一定是静态库比如在/usr/libc.a里实际打包了很多 .o
其中的shr.o就是动态库, 其他的.o是c标准库的.o
ldd /bin/ls
/bin/ls needs:
/lib/libc.a(shr.o)
/unix
/lib/libcrypt.a(shr.o)
$ file /bin/ls
/bin/ls: executable (RISC System/6000) or object module
$ ar -X32 -t /lib/libc.a
frexp.o
itrunc.o
ldexp.o
modf.o
logb.o
scalb.o
finite.o
uitrunc.o
_itrunc.o
_uitrunc.o
fstab.o
getttyent.o
getttynam.o
fill.o
strcat.o
strcpy.o
strcmp.o
strncat.o
strncpy.o
__set_errno128.o
move.o
moveeq.o
memset.o
_qint.o
_qitrunc.o
_qnint.o
_setflm.o
_xlqadd.o
_xlqdiv.o
_xlqmul.o
_xlqsub.o
fsavres.o
longjmp.o
maxi64.o
mini64.o
multi64.o
compi64.o
compu64.o
llabs.o
_quitrunc.o
gsavres.o
clc.o
vsaveres.o
ptrgl.o
shr.o
meth.o
posix_aio.o
aio.o
pse.o
dl.o
pty.o
其实还不止如此,在AIX自带的库里32位库和64为库都是打包在一个.a里的
下面看看/lib/libc.a的例子里
shr.o是32位动态库, shr_64.o是64位动态库,这两个是用于动态链接的,其他的.o是用于静态链接的,_64.o结尾的是用于64位模式, 比如 strcmp.o 这个大家懂的里面是strcmp函数了, strcmp_64.o 是64位版本
$ ar -X32_64 -t /lib/libc.a
frexp.o
itrunc.o
ldexp.o
modf.o
logb.o
scalb.o
finite.o
uitrunc.o
_itrunc.o
_uitrunc.o
fstab.o
getttyent.o
getttynam.o
fill.o
strcat.o
strcpy.o
strcmp.o
strncat.o
strncpy.o
__set_errno128.o
move.o
moveeq.o
memset.o
_qint.o
_qitrunc.o
_qnint.o
_setflm.o
_xlqadd.o
_xlqdiv.o
_xlqmul.o
_xlqsub.o
fsavres.o
longjmp.o
maxi64.o
mini64.o
multi64.o
compi64.o
compu64.o
llabs.o
_quitrunc.o
gsavres.o
clc.o
vsaveres.o
ptrgl.o
frexp_64.o
itrunc_64.o
ldexp_64.o
modf_64.o
logb_64.o
scalb_64.o
finite_64.o
uitrunc_64.o
_itrunc_64.o
_uitrunc_64.o
fstab_64.o
getttyent_64.o
getttynam_64.o
fill_64.o
strcat_64.o
strcpy_64.o
strcmp_64.o
strncat_64.o
strncpy_64.o
__set_errno128_64.o
move_64.o
moveeq_64.o
memset_64.o
_qint_64.o
_qitrunc_64.o
_qnint_64.o
_setflm_64.o
_xlqadd_64.o
_xlqdiv_64.o
_xlqmul_64.o
_xlqsub_64.o
fsavres_64.o
longjmp_64.o
maxi64_64.o
mini64_64.o
multi64_64.o
compi64_64.o
compu64_64.o
llabs_64.o
_quitrunc_64.o
gsavres_64.o
clc_64.o
vsaveres_64.o
ptrgl_64_64.o
shr.o
meth.o
posix_aio.o
aio.o
pse.o
dl.o
pty.o
shr_64.o
posix_aio_64.o
aio_64.o
pse_64.o
dl_64.o
pty_64.o
我用2.0.16-stable没有问题啊
亲自实验了一下。确实没有.so 但是用ar -t 可以看到.a里是有.so的, 所以是可以正常使用的。
$ ar -t libevent-2.0.a
libevent-2.0.so.5
大家有所不知的是在AIX下.a不一定是静态库比如在/usr/libc.a里实际打包了很多 .o
其中的shr.o就是动态库, 其他的.o是c标准库的.o
ldd /bin/ls
/bin/ls needs:
/lib/libc.a(shr.o)
/unix
/lib/libcrypt.a(shr.o)
$ file /bin/ls
/bin/ls: executable (RISC System/6000) or object module
$ ar -X32 -t /lib/libc.a
frexp.o
itrunc.o
ldexp.o
modf.o
logb.o
scalb.o
finite.o
uitrunc.o
_itrunc.o
_uitrunc.o
fstab.o
getttyent.o
getttynam.o
fill.o
strcat.o
strcpy.o
strcmp.o
strncat.o
strncpy.o
__set_errno128.o
move.o
moveeq.o
memset.o
_qint.o
_qitrunc.o
_qnint.o
_setflm.o
_xlqadd.o
_xlqdiv.o
_xlqmul.o
_xlqsub.o
fsavres.o
longjmp.o
maxi64.o
mini64.o
multi64.o
compi64.o
compu64.o
llabs.o
_quitrunc.o
gsavres.o
clc.o
vsaveres.o
ptrgl.o
shr.o
meth.o
posix_aio.o
aio.o
pse.o
dl.o
pty.o
其实还不止如此,在AIX自带的库里32位库和64为库都是打包在一个.a里的
下面看看/lib/libc.a的例子里
shr.o是32位动态库, shr_64.o是64位动态库,这两个是用于动态链接的,其他的.o是用于静态链接的,_64.o结尾的是用于64位模式, 比如 strcmp.o 这个大家懂的里面是strcmp函数了, strcmp_64.o 是64位版本
$ ar -X32_64 -t /lib/libc.a
frexp.o
itrunc.o
ldexp.o
modf.o
logb.o
scalb.o
finite.o
uitrunc.o
_itrunc.o
_uitrunc.o
fstab.o
getttyent.o
getttynam.o
fill.o
strcat.o
strcpy.o
strcmp.o
strncat.o
strncpy.o
__set_errno128.o
move.o
moveeq.o
memset.o
_qint.o
_qitrunc.o
_qnint.o
_setflm.o
_xlqadd.o
_xlqdiv.o
_xlqmul.o
_xlqsub.o
fsavres.o
longjmp.o
maxi64.o
mini64.o
multi64.o
compi64.o
compu64.o
llabs.o
_quitrunc.o
gsavres.o
clc.o
vsaveres.o
ptrgl.o
frexp_64.o
itrunc_64.o
ldexp_64.o
modf_64.o
logb_64.o
scalb_64.o
finite_64.o
uitrunc_64.o
_itrunc_64.o
_uitrunc_64.o
fstab_64.o
getttyent_64.o
getttynam_64.o
fill_64.o
strcat_64.o
strcpy_64.o
strcmp_64.o
strncat_64.o
strncpy_64.o
__set_errno128_64.o
move_64.o
moveeq_64.o
memset_64.o
_qint_64.o
_qitrunc_64.o
_qnint_64.o
_setflm_64.o
_xlqadd_64.o
_xlqdiv_64.o
_xlqmul_64.o
_xlqsub_64.o
fsavres_64.o
longjmp_64.o
maxi64_64.o
mini64_64.o
multi64_64.o
compi64_64.o
compu64_64.o
llabs_64.o
_quitrunc_64.o
gsavres_64.o
clc_64.o
vsaveres_64.o
ptrgl_64_64.o
shr.o
meth.o
posix_aio.o
aio.o
pse.o
dl.o
pty.o
shr_64.o
posix_aio_64.o
aio_64.o
pse_64.o
dl_64.o
pty_64.o
#1
你编译的是静态库,configure时候加个shared编译成动态库。
#2
configure加上shared:
./configure --prefix=/usr --enable-shared
.......
.......
checking size of pthread_t... 4
configure: creating ./config.status
config.status: creating libevent.pc
config.status: creating libevent_openssl.pc
config.status: creating libevent_pthreads.pc
config.status: creating Makefile
config.status: creating include/Makefile
config.status: creating test/Makefile
config.status: creating sample/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands
然后还是没有事生成so文件,感谢你的回复
#3
确认一下 configure的时候动态库的是否能支持, 在config.log里查找shared应该能找到类似的语句
checking whether the cc -qlanglvl=extc89 linker (/usr/bin/ld) supports shared libraries
有些版本的automake/autoconf生成的configure脚本在AIX 6.1上不支持动态库
checking whether the cc -qlanglvl=extc89 linker (/usr/bin/ld) supports shared libraries
有些版本的automake/autoconf生成的configure脚本在AIX 6.1上不支持动态库
#4
楼主可以看一下config.guess文件里有没有这样的内容
*:AIX:*:[45]
*:AIX:*:[45]
#5
什么版本?
我用2.0.16-stable没有问题啊
亲自实验了一下。确实没有.so 但是用ar -t 可以看到.a里是有.so的, 所以是可以正常使用的。
$ ar -t libevent-2.0.a
libevent-2.0.so.5
大家有所不知的是在AIX下.a不一定是静态库比如在/usr/libc.a里实际打包了很多 .o
其中的shr.o就是动态库, 其他的.o是c标准库的.o
ldd /bin/ls
/bin/ls needs:
/lib/libc.a(shr.o)
/unix
/lib/libcrypt.a(shr.o)
$ file /bin/ls
/bin/ls: executable (RISC System/6000) or object module
$ ar -X32 -t /lib/libc.a
frexp.o
itrunc.o
ldexp.o
modf.o
logb.o
scalb.o
finite.o
uitrunc.o
_itrunc.o
_uitrunc.o
fstab.o
getttyent.o
getttynam.o
fill.o
strcat.o
strcpy.o
strcmp.o
strncat.o
strncpy.o
__set_errno128.o
move.o
moveeq.o
memset.o
_qint.o
_qitrunc.o
_qnint.o
_setflm.o
_xlqadd.o
_xlqdiv.o
_xlqmul.o
_xlqsub.o
fsavres.o
longjmp.o
maxi64.o
mini64.o
multi64.o
compi64.o
compu64.o
llabs.o
_quitrunc.o
gsavres.o
clc.o
vsaveres.o
ptrgl.o
shr.o
meth.o
posix_aio.o
aio.o
pse.o
dl.o
pty.o
其实还不止如此,在AIX自带的库里32位库和64为库都是打包在一个.a里的
下面看看/lib/libc.a的例子里
shr.o是32位动态库, shr_64.o是64位动态库,这两个是用于动态链接的,其他的.o是用于静态链接的,_64.o结尾的是用于64位模式, 比如 strcmp.o 这个大家懂的里面是strcmp函数了, strcmp_64.o 是64位版本
$ ar -X32_64 -t /lib/libc.a
frexp.o
itrunc.o
ldexp.o
modf.o
logb.o
scalb.o
finite.o
uitrunc.o
_itrunc.o
_uitrunc.o
fstab.o
getttyent.o
getttynam.o
fill.o
strcat.o
strcpy.o
strcmp.o
strncat.o
strncpy.o
__set_errno128.o
move.o
moveeq.o
memset.o
_qint.o
_qitrunc.o
_qnint.o
_setflm.o
_xlqadd.o
_xlqdiv.o
_xlqmul.o
_xlqsub.o
fsavres.o
longjmp.o
maxi64.o
mini64.o
multi64.o
compi64.o
compu64.o
llabs.o
_quitrunc.o
gsavres.o
clc.o
vsaveres.o
ptrgl.o
frexp_64.o
itrunc_64.o
ldexp_64.o
modf_64.o
logb_64.o
scalb_64.o
finite_64.o
uitrunc_64.o
_itrunc_64.o
_uitrunc_64.o
fstab_64.o
getttyent_64.o
getttynam_64.o
fill_64.o
strcat_64.o
strcpy_64.o
strcmp_64.o
strncat_64.o
strncpy_64.o
__set_errno128_64.o
move_64.o
moveeq_64.o
memset_64.o
_qint_64.o
_qitrunc_64.o
_qnint_64.o
_setflm_64.o
_xlqadd_64.o
_xlqdiv_64.o
_xlqmul_64.o
_xlqsub_64.o
fsavres_64.o
longjmp_64.o
maxi64_64.o
mini64_64.o
multi64_64.o
compi64_64.o
compu64_64.o
llabs_64.o
_quitrunc_64.o
gsavres_64.o
clc_64.o
vsaveres_64.o
ptrgl_64_64.o
shr.o
meth.o
posix_aio.o
aio.o
pse.o
dl.o
pty.o
shr_64.o
posix_aio_64.o
aio_64.o
pse_64.o
dl_64.o
pty_64.o
我用2.0.16-stable没有问题啊
亲自实验了一下。确实没有.so 但是用ar -t 可以看到.a里是有.so的, 所以是可以正常使用的。
$ ar -t libevent-2.0.a
libevent-2.0.so.5
大家有所不知的是在AIX下.a不一定是静态库比如在/usr/libc.a里实际打包了很多 .o
其中的shr.o就是动态库, 其他的.o是c标准库的.o
ldd /bin/ls
/bin/ls needs:
/lib/libc.a(shr.o)
/unix
/lib/libcrypt.a(shr.o)
$ file /bin/ls
/bin/ls: executable (RISC System/6000) or object module
$ ar -X32 -t /lib/libc.a
frexp.o
itrunc.o
ldexp.o
modf.o
logb.o
scalb.o
finite.o
uitrunc.o
_itrunc.o
_uitrunc.o
fstab.o
getttyent.o
getttynam.o
fill.o
strcat.o
strcpy.o
strcmp.o
strncat.o
strncpy.o
__set_errno128.o
move.o
moveeq.o
memset.o
_qint.o
_qitrunc.o
_qnint.o
_setflm.o
_xlqadd.o
_xlqdiv.o
_xlqmul.o
_xlqsub.o
fsavres.o
longjmp.o
maxi64.o
mini64.o
multi64.o
compi64.o
compu64.o
llabs.o
_quitrunc.o
gsavres.o
clc.o
vsaveres.o
ptrgl.o
shr.o
meth.o
posix_aio.o
aio.o
pse.o
dl.o
pty.o
其实还不止如此,在AIX自带的库里32位库和64为库都是打包在一个.a里的
下面看看/lib/libc.a的例子里
shr.o是32位动态库, shr_64.o是64位动态库,这两个是用于动态链接的,其他的.o是用于静态链接的,_64.o结尾的是用于64位模式, 比如 strcmp.o 这个大家懂的里面是strcmp函数了, strcmp_64.o 是64位版本
$ ar -X32_64 -t /lib/libc.a
frexp.o
itrunc.o
ldexp.o
modf.o
logb.o
scalb.o
finite.o
uitrunc.o
_itrunc.o
_uitrunc.o
fstab.o
getttyent.o
getttynam.o
fill.o
strcat.o
strcpy.o
strcmp.o
strncat.o
strncpy.o
__set_errno128.o
move.o
moveeq.o
memset.o
_qint.o
_qitrunc.o
_qnint.o
_setflm.o
_xlqadd.o
_xlqdiv.o
_xlqmul.o
_xlqsub.o
fsavres.o
longjmp.o
maxi64.o
mini64.o
multi64.o
compi64.o
compu64.o
llabs.o
_quitrunc.o
gsavres.o
clc.o
vsaveres.o
ptrgl.o
frexp_64.o
itrunc_64.o
ldexp_64.o
modf_64.o
logb_64.o
scalb_64.o
finite_64.o
uitrunc_64.o
_itrunc_64.o
_uitrunc_64.o
fstab_64.o
getttyent_64.o
getttynam_64.o
fill_64.o
strcat_64.o
strcpy_64.o
strcmp_64.o
strncat_64.o
strncpy_64.o
__set_errno128_64.o
move_64.o
moveeq_64.o
memset_64.o
_qint_64.o
_qitrunc_64.o
_qnint_64.o
_setflm_64.o
_xlqadd_64.o
_xlqdiv_64.o
_xlqmul_64.o
_xlqsub_64.o
fsavres_64.o
longjmp_64.o
maxi64_64.o
mini64_64.o
multi64_64.o
compi64_64.o
compu64_64.o
llabs_64.o
_quitrunc_64.o
gsavres_64.o
clc_64.o
vsaveres_64.o
ptrgl_64_64.o
shr.o
meth.o
posix_aio.o
aio.o
pse.o
dl.o
pty.o
shr_64.o
posix_aio_64.o
aio_64.o
pse_64.o
dl_64.o
pty_64.o