weird error... please help
-
Hello, I have a weird error that I hope someone can help me with: I have a program (SDI), whose view is derived from CPropertyView, a property sheet view by Leo Moll. When I run the application in debug mode, I have no problems whatsoever. However, if I change to release mode, I get the following:
depView.obj : error LNK2001: unresolved external symbol "protected: int __thiscall CDepView::OnCreate(struct tagCREATESTRUCTA *)" (?OnCreate@CDepView@@IAEHPAUtagCREATESTRUCTA@@@Z)
Release/dep.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.dep.exe - 2 error(s), 0 warning(s)
In DepView.h, I have: afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); In DepView.cpp, I have
BEGIN_MESSAGE_MAP(CDepView, CPropertyView)
ON_WM_CREATE()
...
END_MESSAGE_MAP()and
int CDepView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
...
return 0;
}If I remove either the declaration in the header file, or the implementation (and message map) in the source file, it compiles fine, but crashes when I close it (and of course doesnt initialize anything). Does this sound familiar to anyone? I have only seen this error when I forget to include the source file in the project, but I have checked that. What boggles my mind is that it works perfectly in debug mode. Any help/comments would be greatly appreciated, Thanks in advanced, ----------------- Genaro
-
Hello, I have a weird error that I hope someone can help me with: I have a program (SDI), whose view is derived from CPropertyView, a property sheet view by Leo Moll. When I run the application in debug mode, I have no problems whatsoever. However, if I change to release mode, I get the following:
depView.obj : error LNK2001: unresolved external symbol "protected: int __thiscall CDepView::OnCreate(struct tagCREATESTRUCTA *)" (?OnCreate@CDepView@@IAEHPAUtagCREATESTRUCTA@@@Z)
Release/dep.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.dep.exe - 2 error(s), 0 warning(s)
In DepView.h, I have: afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); In DepView.cpp, I have
BEGIN_MESSAGE_MAP(CDepView, CPropertyView)
ON_WM_CREATE()
...
END_MESSAGE_MAP()and
int CDepView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
...
return 0;
}If I remove either the declaration in the header file, or the implementation (and message map) in the source file, it compiles fine, but crashes when I close it (and of course doesnt initialize anything). Does this sound familiar to anyone? I have only seen this error when I forget to include the source file in the project, but I have checked that. What boggles my mind is that it works perfectly in debug mode. Any help/comments would be greatly appreciated, Thanks in advanced, ----------------- Genaro
Just a guess: I'd check the preprocessor definitions for the release build and compare it to that of the debug build. In particular I'd pay attention to the
UNICODE
,_UNICODE
and_MBCS
defines. Steve -
Just a guess: I'd check the preprocessor definitions for the release build and compare it to that of the debug build. In particular I'd pay attention to the
UNICODE
,_UNICODE
and_MBCS
defines. SteveHi Stephen, thanks for the reply. I checked the preprocessor settings, and as far as definitions are concerned, no difference, except for _debug vs. ndebug. For project options, Debug is:
/nologo /MDd /W3 /Gm /GX /ZI /Od /I
"C:\mysql++-1.7.1-win32-vc++\include"
/I
"C:\mysql++-1.7.1-win32-vc++\mysql\include"
/D "WIN32"
/D "_DEBUG"
/D "_WINDOWS"
/D "_AFXDLL"
/D "_MBCS"
/Fp"Debug/dep tool.pch"
/Yu"stdafx.h"
/Fo"Debug/"
/Fd"Debug/"
/FD /GZ /cRelease is:
/nologo /MD /W3 /GX /O2 /I
"C:\mysql++-1.7.1-win32-vc++\include"
/I
"C:\mysql++-1.7.1-win32-vc++\mysql\include"
/D "WIN32"
/D "NDEBUG"
/D "_WINDOWS"
/D "_AFXDLL"
/D "_MBCS"
/FR"Release/"
/Fp"Release/dep tool.pch"
/Yu"stdafx.h"
/Fo"Release/"
/Fd"Release/"
/FD /cI can't find anything that would cause the error there... any clues? ----------------- Genaro
-
Hi Stephen, thanks for the reply. I checked the preprocessor settings, and as far as definitions are concerned, no difference, except for _debug vs. ndebug. For project options, Debug is:
/nologo /MDd /W3 /Gm /GX /ZI /Od /I
"C:\mysql++-1.7.1-win32-vc++\include"
/I
"C:\mysql++-1.7.1-win32-vc++\mysql\include"
/D "WIN32"
/D "_DEBUG"
/D "_WINDOWS"
/D "_AFXDLL"
/D "_MBCS"
/Fp"Debug/dep tool.pch"
/Yu"stdafx.h"
/Fo"Debug/"
/Fd"Debug/"
/FD /GZ /cRelease is:
/nologo /MD /W3 /GX /O2 /I
"C:\mysql++-1.7.1-win32-vc++\include"
/I
"C:\mysql++-1.7.1-win32-vc++\mysql\include"
/D "WIN32"
/D "NDEBUG"
/D "_WINDOWS"
/D "_AFXDLL"
/D "_MBCS"
/FR"Release/"
/Fp"Release/dep tool.pch"
/Yu"stdafx.h"
/Fo"Release/"
/Fd"Release/"
/FD /cI can't find anything that would cause the error there... any clues? ----------------- Genaro
Looks fine. I can't think of anymore suggestions. Good luck Steve
-
Hi Stephen, thanks for the reply. I checked the preprocessor settings, and as far as definitions are concerned, no difference, except for _debug vs. ndebug. For project options, Debug is:
/nologo /MDd /W3 /Gm /GX /ZI /Od /I
"C:\mysql++-1.7.1-win32-vc++\include"
/I
"C:\mysql++-1.7.1-win32-vc++\mysql\include"
/D "WIN32"
/D "_DEBUG"
/D "_WINDOWS"
/D "_AFXDLL"
/D "_MBCS"
/Fp"Debug/dep tool.pch"
/Yu"stdafx.h"
/Fo"Debug/"
/Fd"Debug/"
/FD /GZ /cRelease is:
/nologo /MD /W3 /GX /O2 /I
"C:\mysql++-1.7.1-win32-vc++\include"
/I
"C:\mysql++-1.7.1-win32-vc++\mysql\include"
/D "WIN32"
/D "NDEBUG"
/D "_WINDOWS"
/D "_AFXDLL"
/D "_MBCS"
/FR"Release/"
/Fp"Release/dep tool.pch"
/Yu"stdafx.h"
/Fo"Release/"
/Fd"Release/"
/FD /cI can't find anything that would cause the error there... any clues? ----------------- Genaro
I see at least five differences, which may or may not be the problem. Change the "Relase" values to match the "Debug" values and see if that makes a difference.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
-
I see at least five differences, which may or may not be the problem. Change the "Relase" values to match the "Debug" values and see if that makes a difference.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb