Shared global variable in C++ static library

前端 未结 3 382
走了就别回头了
走了就别回头了 2020-12-10 08:09

I have a MS C++ project (let\'s call it project A) that I am currently compiling as a static library (.lib). It defines a global variable foo. I have two other projects whic

3条回答
  •  囚心锁ツ
    2020-12-10 08:37

    Yes, you have to make A a shared DLL, or else define it as extern in B and C and link all three statically.

提交回复
热议问题