【发布时间】:2010-09-30 21:01:10
【问题描述】:
我在 stdafx.h 中有以下代码。
using namespace std;
typedef struct {
DWORD address;
DWORD size;
char file[64];
DWORD line;
} ALLOC_INFO;
typedef list<ALLOC_INFO*> AllocList;
//AllocList *allocList;
没有注释代码(最后一行),它编译得很好。但是当我添加注释代码时,我收到以下错误。
错误 LNK2005:“类 std::list > * allocList" (?allocList@@3PAV?$list@PAUALLOC_INFO@@V?$allocator@PAUALLOC_INFO@@@std@@@std@@A) 已经在 test.obj 中定义了
我正在使用 Visual Studio .NET 2003。有人知道这是什么以及如何解决它吗?
【问题讨论】:
标签: c++ visual-studio visual-c++