Unresolved external symbol static variable (variable used by method defined in header)

前端 未结 3 767
梦如初夏
梦如初夏 2021-01-19 13:07

Here is the .h:

class Logger
{
private:
    static int mTresholdSeverity;

public:
    static __declspec(dllexport) void log(const char* message);
    static         


        
3条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-19 13:51

    Just so this doesn't get lost in the noise: you can change your accessors into ordinary, non-inline functions and define them in the same source file as your static data member. As long as you export them, you'll be able to call them from anywhere, and they'll access the static data just fine.

提交回复
热议问题