g++ -static -o app tmain.o -L. -ltapi
g++ -shared -fPIC -o libtapi.so tapi.o TGame.o //生成libtapi.so动态库文件
ar cr libtapi.a tapi.o TGame.o //生成libtapi.a静态库文件
-static-libgcc This option links the GNU libgcc library statically. It is the opposite of option shared-libgcc.
-m32
-m64
Generate code for 32-bit or 64-bit environments of Darwin and SVR4 targets (including GNU/Linux). The 32-bit
environment sets int, long and pointer to 32 bits and generates code that runs on any PowerPC variant. The
64-bit environment sets int to 32 bits and long and pointer to 64 bits, and generates code for PowerPC64, as
for -mpowerpc64.
ldd 可执行程序能查看程序链接的库
-o -o1 -o2 -o3 优化代码
***********代码调试
-g -o0表示不进行代码优化
-fPIC 产生位置无关的代码,一般创建共享库时需要
GNU Tools使用
显示归档文件中的内容 ar -tv 或者 odjdump -a
nm 能够列出目标文件中的符号
size 能够列出目标文件各节的大小