C++ .Net MFC linker errors? [Help]

Rimmel

Newcomer
Joined
Mar 12, 2004
Messages
5
Hi everyone, I am trying to get to grips with c++ .net and c++ win32, in .net 2003.

The problem I have is that when I create an mfc (dialog based) project in .net 2003 and try to run it (I didnt add even a single line of code) then it gives a linker error (below) I have looked all over for a resolution you cannot find one. Can anyone help? please?

It seems to relate to "stdafx.h" (stdafx.obj : error LNK2019:) but I cannot work out how to fix it...

Error codes
---------------------------------------------------------------------

Build Log ------- Build started: Project: mfc_test_02, Configuration: Debug|Win32 -------

Command Lines Creating temporary file "c:\Development\Visual Studio Projects\mfc_test_02\mfc_test_02\Debug\RSP000002.rsp" with contents
[
/Od /D "WIN32" /D "_WINDOWS" /D "_DEBUG" /D "_MBCS" /Gm /EHsc /RTC1 /MTd /Zc:wchar_t /Yu"stdafx.h" /Fp"Debug/mfc_test_02.pch" /Fo"Debug/" /Fd"Debug/vc70.pdb" /W3 /c /Wp64 /ZI /TP
".\mfc_test_02.cpp"
]
Creating command line "cl.exe @"c:\Development\Visual Studio Projects\mfc_test_02\mfc_test_02\Debug\RSP000002.rsp" /nologo"
Creating temporary file "c:\Development\Visual Studio Projects\mfc_test_02\mfc_test_02\Debug\RSP000003.rsp" with contents
[
/OUT:"Debug/mfc_test_02.exe" /INCREMENTAL /NOLOGO /LIBPATH:"/LIBPATH:C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include" /DELAYLOAD:"OleAcc.dll" /DEBUG /PDB:"Debug/mfc_test_02.pdb" /SUBSYSTEM:WINDOWS /MACHINE:X86 DelayImp.lib DelayImp.lib
".\Debug\mfc_test_02.obj"
".\Debug\mfc_test_02Dlg.obj"
".\Debug\stdafx.obj"
".\Debug\mfc_test_02.res"
]
Creating command line "link.exe @"c:\Development\Visual Studio Projects\mfc_test_02\mfc_test_02\Debug\RSP000003.rsp""
Output Window Compiling...
mfc_test_02.cpp
Linking...
stdafx.obj : error LNK2019: unresolved external symbol "unsigned long __cdecl _exception_code(void)" (?_exception_code@@YAKXZ) referenced in function "bool __cdecl ATL::_ATL_SAFE_ALLOCA_IMPL::_AtlVerifyStackAvailable(unsigned long)" (?_AtlVerifyStackAvailable@_ATL_SAFE_ALLOCA_IMPL@ATL@@YA_NK@Z)
Debug/mfc_test_02.exe : fatal error LNK1120: 1 unresolved externals
Results Build log was saved at "file://c:\Development\Visual Studio Projects\mfc_test_02\mfc_test_02\Debug\BuildLog.htm"
mfc_test_02 - 2 error(s), 0 warning(s)
 
Last edited:
Rimmel said:
Bump .... :o

Perhaps this forum would be better named the "ratheraveragedotnettalk.com" ;)
Just a guess but when you installed VC++ did you install the runtime libraries - and both the ANSI / UNICODE versions.
It could be trying to link to a version you didn't install.
 
PlausiblyDamp said:
Just a guess but when you installed VC++ did you install the runtime libraries - and both the ANSI / UNICODE versions.
It could be trying to link to a version you didn't install.

Thanks for the suggestion, I looked at the installed libraries and all the ANSI/UNICODE VERSIONS are installed.

Rimmel™
 
So you get this with a default install and then a new project with no modifications? Maybe give us the exact steps you took to get this error.

Also, I wouldn't "bump" a post so soon. It's in bad taste if you haven't waited at least a couple of days and might keep some otherwise helpful users from posting.

-ner
 
Back
Top