COM proxy build errors LNK2001: unresolved externals with OPT.DEBUG=YES
search cancel

COM proxy build errors LNK2001: unresolved externals with OPT.DEBUG=YES

book

Article ID: 381352

calendar_today

Updated On:

Products

Gen

Issue/Introduction

Gen 8.6 sample model COM proxy build errors when OPT.DEBUG=YES in Build Tool profile:

**********
---Compiles for P900CM.DLL Dependencies done
...Linking P900CM.DLL
    link /NOLOGO  /DLL /SUBSYSTEM:WINDOWS  /MACHINE:X86  /NODEFAULTLIB:LIBCMT.LIB -DEBUG /NODEFAULTLIB MSVCRT.LIB KERNEL32.LIB /def:"C:\Users\Administrator\Documents\CA\Gen 8.6\Models\sampcpxy.ief\proxy\com\src\P900\P900CM.DEF" /out:"C:\Users\Administrator\Documents\CA\Gen 8.6\Models\sampcpxy.ief\proxy\com\deploy\P900\P900CM.DLL" @"C:\Users\Administrator\Documents\CA\Gen 8.6\Models\sampcpxy.ief\proxy\com\src\P900\P900CM.lnk"
   Creating library C:\Users\Administrator\Documents\CA\Gen 8.6\Models\sampcpxy.ief\proxy\com\deploy\P900\P900CM.lib and object C:\Users\Administrator\Documents\CA\Gen 8.6\Models\sampcpxy.ief\proxy\com\deploy\P900\P900CM.exp
P900ECM.OBJ : error LNK2001: unresolved external symbol __purecall
P900ECM.OBJ : error LNK2019: unresolved external symbol __imp___invalid_parameter_noinfo referenced in function _memcpy_s
P900ECM.OBJ : error LNK2019: unresolved external symbol __imp___errno referenced in function _memcpy_s
ServerDetailEmployeeCM.OBJ : error LNK2001: unresolved external symbol __imp__free
ServerMaintainDepartmentCM.OBJ : error LNK2001: unresolved external symbol __imp__free
ServerMaintainDivisionCM.OBJ : error LNK2001: unresolved external symbol __imp__free
ServerMaintainEmployeeCM.OBJ : error LNK2001: unresolved external symbol __imp__free
P900ECM.OBJ : error LNK2001: unresolved external symbol __imp__free
P900MCM.OBJ : error LNK2001: unresolved external symbol __imp__free
ServerDetailDepartmentCM.OBJ : error LNK2001: unresolved external symbol __imp__free
ServerDetailDivisionCM.OBJ : error LNK2001: unresolved external symbol __imp__free
ServerMaintainDepartmentCM.OBJ : error LNK2001: unresolved external symbol __imp__malloc
ServerMaintainDivisionCM.OBJ : error LNK2001: unresolved external symbol __imp__malloc
ServerMaintainEmployeeCM.OBJ : error LNK2001: unresolved external symbol __imp__malloc
P900ECM.OBJ : error LNK2001: unresolved external symbol __imp__malloc
ServerDetailDepartmentCM.OBJ : error LNK2001: unresolved external symbol __imp__malloc
ServerDetailDivisionCM.OBJ : error LNK2001: unresolved external symbol __imp__malloc
ServerDetailEmployeeCM.OBJ : error LNK2001: unresolved external symbol __imp__malloc
P900ECM.OBJ : error LNK2019: unresolved external symbol __imp___recalloc referenced in function "public: int __thiscall ATL::CSimpleMap<char *,wchar_t *,class ATL::CExpansionVectorEqualHelper>::Add(char * const &,wchar_t * const &)" (?Add@?$CSimpleMap@PADPA_WVCExpansionVectorEqualHelper@ATL@@@ATL@@QAEHABQADABQA_W@Z)
P900ECM.OBJ : error LNK2019: unresolved external symbol __imp___resetstkoflw referenced in function "bool __cdecl ATL::_ATL_SAFE_ALLOCA_IMPL::_AtlVerifyStackAvailable(unsigned long)" (?_AtlVerifyStackAvailable@_ATL_SAFE_ALLOCA_IMPL@ATL@@YA_NK@Z)
P900ECM.OBJ : error LNK2019: unresolved external symbol _memcmp referenced in function "public: long __thiscall ATL::CComTypeInfoHolder::GetIDsOfNames(struct _GUID const &,wchar_t * *,unsigned int,unsigned long,long *)" (?GetIDsOfNames@CComTypeInfoHolder@ATL@@QAEJABU_GUID@@PAPA_WIKPAJ@Z)
ServerMaintainDepartmentCM.OBJ : error LNK2001: unresolved external symbol _memcpy
ServerMaintainDivisionCM.OBJ : error LNK2001: unresolved external symbol _memcpy
ServerMaintainEmployeeCM.OBJ : error LNK2001: unresolved external symbol _memcpy
P900ECM.OBJ : error LNK2001: unresolved external symbol _memcpy
ServerDetailDepartmentCM.OBJ : error LNK2001: unresolved external symbol _memcpy
ServerDetailDivisionCM.OBJ : error LNK2001: unresolved external symbol _memcpy
ServerDetailEmployeeCM.OBJ : error LNK2001: unresolved external symbol _memcpy
MSVCRT.LIB(utility_desktop.obj) : error LNK2001: unresolved external symbol _memset
...
**********

The GUI C client builds correctly with same setting.

Environment

Gen COM Proxy

Cause

The BT scripts are located in directory "%Gen86%Gen\bt\scripts".

The COM proxy build script build_proxy_com.scr contains these link settings for the OPT.DEBUG value check:
{[IF]} EQUAL "{$toUpperCase({OPT.DEBUG})}" "YES"
CFLAGS=$(CFLAGS) -Zi -Od -UNDEBUG
DLLLINK=$(DLLLINK) -DEBUG /NODEFAULTLIB MSVCRT.LIB KERNEL32.LIB
EXELINK=$(EXELINK) -DEBUG
{[ENDIF]}

However for the C client build where there is no error the corresponding script build_lm_c.scr section contains these link settings:
{[IF]} EQUAL "{$toUpperCase({OPT.DEBUG})}" "YES"
CFLAGS=$(CFLAGS) -Z7 -Od
DLLLINK=/DEBUG $(DLLLINK)
STUBLINK=/DEBUG $(STUBLINK)
{[ENDIF]}


The build_proxy_com.scr script is out of date and needs to use the same link settings as build_lm_c.scr.

Resolution

The build_proxy_com.scr script will be updated by a future BTN* PTF.

As a workaround, backup the current build_proxy_com.scr and edit it to match the link settings in the build_lm_c.scr for the OPT.DEBUG value check.

Additional Information