gcc 混合连接动态库和静态库

当对动态库与静态库混合连接的时候,使用-static会导致所有的库都使用静态连接的方式。这时需要作用-Wl的方式

gcc test.cpp -L. -Wl,-Bstatic -ltestlib  -Wl,-Bdynamic -ltestlib

原文地址:https://www.cnblogs.com/qiumingcheng/p/7802279.html