hewumars
4/10/2019 - 2:44 AM

glibc静态编译

LIBS += -l<auto-link-lib> STATIC_LIBS += -l<static-lib> DYN_LIBS += -l<dynamic-lib> LDFLAGS := LIBS -Wl,-Bstatic ${STATIC_LIBS} -Wl,-Bdynamic ${DYN_LIBS}

gcc main.c -Wl,-Bstatic -lstdc++ -lgcc -ldl -lpthread -Wl,-Bdynamic -lgcc_s -o main g++ *.c -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic -lgcc_s *