Linker error when using static members

后端 未结 2 1632
滥情空心
滥情空心 2020-12-11 22:06

I\'m using Qt 4.7 and Cmake 2.8.3 with g++ 4.2.1 on Mac OS X.

I\'m getting a bizarre linker error when using static or global variables in one of my files. Here\'s t

2条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-11 22:44

    Static data members must be explicitly defined in exactly one compilation unit

    See this link: http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.12

提交回复
热议问题