in reply to [OT - MS Visual Studio] How to build a dll that Win32::API can access

Hi, Rob ! As for your 2nd question : cl /Gz double_test double.lib works fine. /Gz forces __stdcall which means : look for decorated names like _my_double@4 (while default __cdecl makes the linker look for decorated names like _my_double = exactly the LNK2019 error you get) See http://msdn.microsoft.com/en-us/library/x7kb4e2f.aspx for (C) decorated names. Regards, Jean-Marc
  • Comment on Re: [OT - MS Visual Studio] How to build a dll that Win32::API can access

Replies are listed 'Best First'.
Re^2: [OT - MS Visual Studio] How to build a dll that Win32::API can access
by syphilis (Archbishop) on May 26, 2008 at 02:23 UTC
    As for your 2nd question : cl /Gz double_test double.lib

    Aaah ... I see. Thanks. (You meant "double_test.c", not "double_test".)

    As regards http://msdn.microsoft.com/en-us/library/x7kb4e2f.aspx, it says there that __cdecl is decorated with a leading underscore, yet dumpbin /exports reports that there is no leading underscore when I build with __cdecl (/Gd). On the other hand, what is written on that page regarding __fastcall (/Gr) and __stdcall (/Gz), is in complete agreement with what dumpbin /exports reports for dll's built with those calling conventions.

    I have just managed to build a dll that Win32::API can access ... but only if the function being accessed takes no arguments.

    Cheers,
    Rob