o: 编译的目标文件
gcc -c test.c
a: 静态库,其实就是把若干o文件打了个包
ar -r libtest.a test1.o test2.o
so: 动态链接库(共享库)
gcc -Wall -fpic -shared -Ltest test3.c -o libtest.so
lo: 使用libtool编译出的目标文件,其实就是在o文件中添加了一些信息
$libtool --mode=compile gcc -c libmylib.lo
比如geotiff.lo的内容为:
# ../o/geotiff.lo - a libtool object file
# Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1
#
# Please DO NOT delete this file!
# It is necessary for linking the library.
# Name of the PIC object.
pic_object='.libs/geotiff.o'
# Name of the non-PIC object
non_pic_object='geotiff.o'
la: 使用libtool编译出的库文件,其实是个文本文件,记录同名动态库和静态库的相关信息
$libtool --mode=link gcc -o libmylib.la -rpath /usr/lib –L/usr/lib –la,会根据相应的规则生成相应的共享库和静态库。
比如libgdal.la的内容如下:
# libgd