Linking error of CxxFrameHandler3

A

Angela Yan

Hi all,

I have a dll compiled using DDK 3790.1218 WNet environment. Everything works
fine until recently I need to link a Lib file that is complied using C++ in
VS2005. After I add the Lib file in my DLL's sources file, I have the
following linking error.

1>1>ABC_mt.lib(ABCs.obj) : error LNK2019: unresolved external symbol
__vswprintf referenced in function "int __cdecl swprintf(unsigned short
*,unsigned short const *,...)" (?swprintf@@YAHPAGPBGZZ)
1>1>ABC_mt.lib(ABCs.obj) : error LNK2019: unresolved external symbol
___CxxFrameHandler3 referenced in function __ehhandler$?MD5String@@YAXPAD0@Z

Part of the linking configuration of the DLL sources files:

TARGETTYPE = DYNLINK
TARGETPATH = bin$(BUILD_ALT_DIR)
TARGETEXT = dll
DLLENTRY = _DllMainCRTStartup
........

INCLUDES = $(DDK_INC_PATH);$(SDK_INC_PATH);..\Include;..\IDL;..

TARGETLIBS = $(DDK_LIB_PATH)\portcls.lib \
$(DDK_LIB_PATH)\stdunk.lib \
$(DDK_LIB_PATH)\libcntpr.lib \
$(DDK_LIB_PATH)\kernel32.lib \
$(DDK_LIB_PATH)\user32.lib \
$(DDK_LIB_PATH)\advapi32.lib \
$(DDK_LIB_PATH)\winmm.lib \
$(DDK_LIB_PATH)\version.lib \
$(DDK_LIB_PATH)\uuid.lib \
$(DDK_LIB_PATH)\ole32.lib \
$(DDK_LIB_PATH)\oleaut32.lib \
$(DDK_LIB_PATH)\hid.lib \
$(DDK_LIB_PATH)\dsound.lib \
$(DDK_LIB_PATH)\setupapi.lib \
$(DDK_LIB_PATH)\strsafe.lib \
$(DDK_LIB_PATH)\SHFolder.lib \
$(DDK_LIB_PATH)\shell32.lib \
$(DDK_LIB_PATH)\iphlpapi.lib \
$(DDK_LIB_PATH)\shlwapi.lib \
IHLSDK\lib\ABC_MT.lib

USE_MSVCRT = 1
USE_STATIC_ATL = 1
ATL_VER = 30

MSC_WARNING_LEVEL = $(MSC_WARNING_LEVEL) -WX

C_DEFINES = $(CFASTFLAGS) $(C_DEFINES) -DWIN32 -D_MERGE_DEVCON32_ -D_USRDLL
C_DEFINES = $(C_DEFINES) -DNDEBUG -D_WINDOWS

Commands for the Lib file in VS2005:

C/C++ command line:
/O2 /Ob1 /I "..\APO\\" /I ".\\" /D "_APO" /D "WIN32" /D "NDEBUG" /D
"UNICODE" /D "_LIB" /D "IHLICENSE_EXPORTS" /D "_VC80_UPGRADE=0x0600" /D
"_UNICODE" /D "_ATL_STATIC_REGISTRY" /GF /FD /EHsc /MT /Gy /Zc:wchar_t-
/Yu"stdafx.h" /Fp"C:\WUTemp\Dump\IHLic/IHLicense.pch"
/Fo"C:\WUTemp\Dump\IHLic/" /Fd"C:\WUTemp\Dump\IHLic/" /FR"APO_MT\\" /W3
/nologo /c /TP /errorReport:prompt

Librarian command line:
/OUT:"APO\APOIHLObj_MT.lib" /NOLOGO /NODEFAULTLIB

Any help is appreciated.

Thank you.

Angela
 
B

Ben Voigt [C++ MVP]

Angela Yan said:
Hi all,

I have a dll compiled using DDK 3790.1218 WNet environment. Everything
works fine until recently I need to link a Lib file that is complied using
C++ in VS2005. After I add the Lib file in my DLL's sources file, I have
the following linking error.

Is this kernel mode or user mode?

Kernel mode components should be compiled and linked using the DDK build
environment. User mode components can be compiled with the DDK compiler and
headers then linked into DLLs and applications using other compilers. In
general you can't use standard C++ in kernel mode because C++ needs a
runtime library that isn't present, however there are kernel mode versions
of the runtime library that allow some subset of C++. For user mode it
should be no problem, but use the VS2005 linker and runtime library to link
together the C++ and DDK compiled object files.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top