静态库
target:objs
ar -cr target objs lib_path/*.o
objs:%.o:%.c
gcc -shared -fPIC -c $< -o $@ $(include_path) -lws2_32
动态库:
target_so:objs
gcc -fPIC -c -o target_so objs -L$(lib_path) -llibname -lws2_32
VS 上#pragma comment( lib, "ws2_32.lib ")
对应makefile中应有-lws2_32