【发布时间】:2013-04-04 13:31:25
【问题描述】:
我在这个问题上被困了几天,即使谷歌回复了很多,我也找不到我的问题的答案,这似乎是一个相当抽象的问题。
这是我在 H 中的代码:
struct DISPLAYLINE_t {
char *text;
bool isWhite;
void set(char *txt, bool iswhite){text = txt; isWhite = iswhite;};
};
struct DISPLAY {
static DISPLAYLINE_t line1,line2,line3,line4;
void clear(){//dostuff};
};
当我尝试从我的 Main 访问时:
DISPLAY::line1.set(string, FALSE);
我收到以下错误:
错误 LNK2019:未解析的外部符号 "public: static struct DISPLAY::line1" (?line1@DISPLAY@@2UDISPLAYLINE_t@@A) 在函数 WinMain 中引用
有什么想法吗?
【问题讨论】:
-
课程是公开的吗?
标签: c++ linker embedded unresolved-external