By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,805 Members | 1,056 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,805 IT Pros & Developers. It's quick & easy.

VC2005 - Basic_MFC_app.obj : error LNK2001: unresolved external symbol "public: static wchar_t * CTest::m_static00" (?m_static00@CTest@@2PA_WA)

P: n/a
Hi All,

I have come across a problem with a bog std MFC app linking to bog std MFC
extension dll - both generated by the wizards. The code is set out below.

The trouble is with the static member variable of CTest.

Can anyone help?

Thanks

Sam

// test.hpp

// CTest

class AFX_CLASS_EXPORT CTest : public CWnd

{

DECLARE_DYNAMIC(CTest)

public:

CTest();

virtual ~CTest();

protected:

DECLARE_MESSAGE_MAP()

public:

TCHAR * m_test00;

static TCHAR * m_static00;
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!

};

// end of test.hpp

// test mfc extension dll code

// Test.cpp : implementation file

//

#include "stdafx.h"

#include "Test.hpp"

// CTest

IMPLEMENT_DYNAMIC(CTest, CWnd)

CTest::CTest()

: m_test00(_T("m_test00 OK"))

{

}

CTest::~CTest()

{

}

TCHAR * CTest::m_static00(_T("m_static00 OK"));

BEGIN_MESSAGE_MAP(CTest, CWnd)

END_MESSAGE_MAP()

// end Test.cpp

// test mfc app code

#include "test.hpp"

CTest test;

MessageBox(0, CTest::m_static00, test.m_test00, MB_OK);

// end of test mfc extension code

Error message:

Basic_MFC_app.obj : error LNK2001: unresolved external symbol "public:
static wchar_t * CTest::m_static00" (?m_static00@CTest@@2PA_WA)


Apr 25 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.