1. 静态库的生成
gcc -c hello.c
ar cr libmyhello.a hello.o
2. 动态库的生成
$(CC) -O -c -fPIC -o mo_test.o mo_test.cpp
$(CC) -shared -o libmo_test.so mo_test.o
1. 静态库的生成
gcc -c hello.c
ar cr libmyhello.a hello.o
2. 动态库的生成
$(CC) -O -c -fPIC -o mo_test.o mo_test.cpp
$(CC) -shared -o libmo_test.so mo_test.o