方法一 -Wl,-Bstatic指示链接libtest.a静态库, -Wl,-Bdynamic指示链接系统动态库。 make文件示例: LIBS += -Bstatic -lcjson LIBS += -Bdynamic -lmosquitto 方法二 gcc test.c -static