g++: In what order should static and dynamic libraries be linked?

后端 未结 5 1181
醉酒成梦
醉酒成梦 2020-12-04 18:44

Let\'s say we got a main executable called \"my_app\" and it uses several other libraries: 3 libraries are linked statically, and other 3 are linked dynamically. In which or

5条回答
  •  -上瘾入骨i
    2020-12-04 19:12

    I worked in a project with a bunch of internal libraries that unfortunately depended on each other (and it got worse over time). We ended up "solving" this by setting up SCons to specify all libs twice when linking:

    g++ ... -la1 -la2 -la3 -la1 -la2 -la3 ...
    

提交回复
热议问题