相关疑难解决方法(0)

未定义的静态成员引用

我正在使用交叉编译器.我的代码是:

class WindowsTimer{
public:
  WindowsTimer(){
    _frequency.QuadPart = 0ull;
  } 
private:
  static LARGE_INTEGER _frequency;
};
Run Code Online (Sandbox Code Playgroud)

我收到以下错误:

对WindowsTimer :: _ frequency'的未定义引用

我也尝试将其改为

LARGE_INTEGER _frequency.QuadPart = 0ull;
Run Code Online (Sandbox Code Playgroud)

要么

static LARGE_INTEGER _frequency.QuadPart = 0ull;
Run Code Online (Sandbox Code Playgroud)

但我仍然得到错误.

有谁知道为什么?

c++ cross-compiling undefined-reference

70
推荐指数
4
解决办法
6万
查看次数

标签 统计

c++ ×1

cross-compiling ×1

undefined-reference ×1