static variable initialisation code never gets called

后端 未结 3 883
一整个雨季
一整个雨季 2020-12-21 21:38

I\'ve got an application that\'s using a static library I made. One .cpp file in the library has a static variable declaration, whose ctor calls a function on a singleton th

3条回答
  •  天涯浪人
    2020-12-21 21:53

    Refactor the classes doing static initialization so they do not depend on any other such classes. That is, make each class's initialization independent and self-sufficient.

提交回复
热议问题