Can I mix static and shared-object libraries when linking?

前端 未结 1 1348
梦如初夏
梦如初夏 2020-11-27 10:59

I have a C project that produces ten executables, all of which I would like to be linked in statically. The problem I am facing is that one of these executables uses a 3rd-p

相关标签:
1条回答
  • 2020-11-27 11:22

    Looking at this thread you can see that it can be done. The guys at GNU suggest

    gcc foo.c -Wl,-Bstatic -lbar -lbaz -lqux -Wl,-Bdynamic -lcorge -o foo.exe
    
    0 讨论(0)
提交回复
热议问题