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

后端 未结 5 1185
醉酒成梦
醉酒成梦 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条回答
  •  天命终不由人
    2020-12-04 19:00

    The dependencies for linking a library or executable have to be present at link-time, so you cannot link libXC before libXB is present. It doesn't matter if statically or dynamically.

    Start with the most basic one, which has no (or just outside of your project) dependencies.

提交回复
热议问题