linux 编译动态链接 1、gcc 编译: gcc -o test.so -shared -fPIC test1.c 2、g++编译: g++ -o test2.so -shared -fPIC test2.c