相关疑难解决方法(0)

静态结构链接器错误

我正在尝试在C++中创建一个静态结构:

static struct Brushes
{
  static HBRUSH white ;
  static HBRUSH yellow ;
} ;

但它不起作用,我得到:

Error 4 error LNK2001: unresolved external symbol "public: static struct HBRUSH__ * Brushes::white"

为什么?

这样做是为了能够使用Brushes::white,Brushes::yellow在整个程序中,而无需创建的实例Brushes.

c++ static struct

3
推荐指数
2
解决办法
1352
查看次数

标签 统计

c++ ×1

static ×1

struct ×1