Re: Turning off name-decoration



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
.



Relevant Pages

  • Re: Problem with a DLL and a Static Library
    ... In the header file of the LIB, ... I've inlcuded the sameheader file in the DLL ...
    (microsoft.public.vc.language)
  • Re: where can I find WZCQueryInterface?
    ... I am facing a similar problem of not finding the lib & header file for ... DeviceIoControl, but am still curious about the WZCQueryInterface ... or the lib are on my system. ...
    (microsoft.public.pocketpc.wireless)
  • Re: Cannot link with library
    ... Is there any header file for these functions that i can ... projects doesn't specify /NODEFAULTLIB linker option (Ignore ... function is missing (i.e., linker errors), then look up in ... MSDN what the .LIB file you should add to the project. ...
    (microsoft.public.vc.language)
  • Re: Linmking problem
    ... > I have a got a library (actually the whole dang project) that compiles fine ... i have added the header file in my new project and have added the ... i am attaching the header and lib ...
    (microsoft.public.vc.language)
  • Re: 3rd party library in VC++/MFC
    ... Yeah sure you need header file two know what function defination reside in ... Alok Gupta ... I thought you can include this *.lib file by using following ...
    (microsoft.public.vc.language)