Advertisement

MFC problem

Started by July 27, 2000 08:25 PM
0 comments, last by jho 24 years, 4 months ago
I''m new to MFC. I tried to create a new project in my workspace, a shared MFC DLL, I just use the class wizard to add a class called testWnd, inheriting CWnd. How come when I try to declare it as a variable in my Main program I get main.obj : error LNK2001: unresolved external symbol "public: virtual __cdecl testWnd::~testWnd(void)" (??1testWnd@@UAA@XZ) What does that mean?.. I already include the .lib file here''s my .h and .cpp file that VS generated.. //testWnd.h class testWnd : public CWnd { // Construction public: testWnd(); // Attributes public: // Operations public: // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(testWnd) //}}AFX_VIRTUAL // Implementation public: virtual ~testWnd(); // Generated message map functions protected: //{{AFX_MSG(testWnd) // NOTE - the ClassWizard will add and remove member functions here. //}}AFX_MSG DECLARE_MESSAGE_MAP() }; // testWnd1.cpp : implementation file // #include "stdafx.h" #include "resource.h" #include "testWnd1.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // testWnd testWnd::testWnd() { } testWnd::~testWnd() { } BEGIN_MESSAGE_MAP(testWnd, CWnd) //{{AFX_MSG_MAP(testWnd) // NOTE - the ClassWizard will add and remove mapping macros here. //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // testWnd message handlers Thanks in advnace..
Why is your header file named "testWnd.h" and the source file named "testWnd1.cpp"?

It''s a long shot, but try this. Open your testWnd1.cpp file in Visual Studio. Right click on the code. From the pop-up menu, select "Insert File into Project". Note that the file doesn''t get compiled or linked if its not in the project.

This topic is closed to new replies.

Advertisement