BUG: LNK2001 Error for Static Member in Class Template (151167)
The information in this article applies to:
- Microsoft Visual C++ 2.0
- Microsoft Visual C++ 2.1
- Microsoft Visual C++ 2.2
- Microsoft Visual C++ 4.0
- Microsoft Visual C++ 4.1
- Microsoft Visual C++, 32-bit Enterprise Edition 4.2
- Microsoft Visual C++, 32-bit Enterprise Edition 5.0
- Microsoft Visual C++, 32-bit Professional Edition 4.2
- Microsoft Visual C++, 32-bit Professional Edition 5.0
This article was previously published under Q151167 SYMPTOMS
Linker error LNK2001 is generated for static member variables of nested
classes in class templates. The message states:
error LNK2001: unresolved external symbol "public: static int
Outer<int>::Inner::sobj"(?sobj@Inner@?$Outer@H@@2HA)
RESOLUTION
Do not use static member variables in nested classes of class templates.
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article.
Modification Type: | Major | Last Reviewed: | 12/2/2003 |
---|
Keywords: | kbBug kbCompiler kbCPPonly KB151167 |
---|
|