【发布时间】:2021-12-13 16:09:01
【问题描述】:
我正在使用交叉编译器。我的代码是:
class WindowsTimer{
public:
WindowsTimer(){
_frequency.QuadPart = 0ull;
}
private:
static LARGE_INTEGER _frequency;
};
我收到以下错误:
对 `WindowsTimer::_frequency' 的未定义引用
我也试过改成
LARGE_INTEGER _frequency.QuadPart = 0ull;
或
static LARGE_INTEGER _frequency.QuadPart = 0ull;
但我仍然遇到错误。
有人知道为什么吗?
【问题讨论】:
-
你在哪里(如果有的话)定义
WindowsTimer::_frequency? -
@CharlesBailey 这是我班上唯一的成员。
标签: c++ undefined-reference cross-compiling