Re: Turning off name-decoration



Just "Initialize"...

"Victor Bazarov" <v.Abazarov@xxxxxxxxxxxx> wrote in message
news:uG1$Pb3IGHA.2912@xxxxxxxxxxxxxxxxxxxxxxx
> TheBlasphemer wrote:
>> I've got a DLL file that I want to access from my code. To achieve this I
>> used:
>> dumpbin <filename> /exports
>> then made a .def file and ran
>> lib /def:deffile
>> which gives me a nice library file.
>> Next in the header file I tried to add a function:
>> HRESULT __stdcall Initialize(GUID *guid, DWORD IDCRLVersion /* should be
>> 1 */, DWORD dwFlags /*should be 0xF*/);
>>
>> But that fails with the message:
>>
>> 1>main.obj : error LNK2019: unresolved external symbol "long __stdcall
>> Initialize(struct _GUID *,unsigned long,unsigned long)"
>> (?Initialize@@YGJPAU_GUID@@KK@Z) referenced in function _main
>>
>> I also tried adding extern "C" to it, but even that resulted in:
>>
>> 1>main.obj : error LNK2019: unresolved external symbol _Initialize@12
>> referenced in function _main
>>
>>
>>
>> Is there a way to turn off name mangling completely? or is there another
>> way to get this to link properly?
>
> When you do 'dumpbin /exports', what's the actual name of the symbol
> that corresponds to the 'Initialize' function?
>
> V
> --
> Please remove capital As from my address when replying by mail
> Sorry, I do not respond to top-posted replies, please don't ask


.