My 32bit windows program is using default __cdecl calling convention. It is using Qt toolkit. I'm trying to use unamanged dll that is using __stdcall convention and exports only undecorated names.
dumpbin /exports library.dll
[...]
00000000 characteristics
0 time date stamp
0.00 version
1 ordinal base
210 number of functions
210 number of names
ordinal hint RVA name
[...]
6 9D 0000361C OpenComm
[...]
I created .def file with decorated name mapping:
EXPORTS
_OpenComm@8=OpenComm
As a result .lib has following export (notice the double underscore in front):
__OpenComm@8
Header file contains (notice underscore that I had to put there to match .lib):
extern "C"
{
int __stdcall _OpenComm(char *com, int Baudrate);
}
Program compiles fine but when I try to run it runtime linker gives me an error:
The procedure entry point _OpenComm@8 could not be located in the dynamic link library.
OK. Dll does not have my mapped name ... How can I solve this ? Can I rename exports inside compiled .dll ? :-)