But ... if I want to specify either __stdcall (/Gz switch) or __cdecl (/Gd switch) am I supposed to first remove the __cdeclspec(dllexport) from the prototype and definition of the function ? I would assume that __cdeclspec(dllexport) implies the __cdecl convention anyway. So if the prototype and definition contain "__cdeclspec(dllexport)", then you're implying __cdecl when you build the dll with cl /LD double.c