Article ID: 149784
Article Last Modified on 7/5/2005
/* Compile options needed: none
*/
#include <iostream.h>
#include <stdio.h>
class A
{
public:
static __declspec(thread) int idata;
void test(void);
};
__declspec(thread) int A::idata = 2; // remove this __declspec(thread) to
// eliminate unresolved external
error
void A::test(void)
{
cout<<idata;
}
void main(void)
{
A theA;
theA.test();
}
Additional query words: 4.00 lnk2001 lnk1120 L2029 unresolved external LINK
Keywords: kbbug kbfix kbcpponly kbcompiler KB149784