This works with MSVC (compile and link).
extern void (_TMDLLENTRY * _TMDLLENTRY tpsetunsol _((void (_TMDLLENTRY *)(char _TM_FAR *, long, long)))) _((char _TM_FAR *, long, long));
But with GCC compiling is ok but linking phase fails with undefined reference
pointing to this. Is this declaration already GCC compatible or is there possibly some other problem?
#define _TMDLLENTRY __stdcall
#define _TM_FAR
nm
output from MSVC created object file:
00000000 N .debug$S
00000000 N .debug$S
00000000 N .debug$S
00000000 N .debug$S
00000000 N .debug$T
00000000 i .drectve
00000000 r .rdata
00000000 r .rdata
00000000 r .rdata
00000000 t .text
00000000 t .text
00000000 t .text
U @__security_check_cookie@4
00aa766f a @comp.id
00000001 a @feat.00
U ___security_cookie
U __imp__CloseClipboard@0
U __imp__EmptyClipboard@0
U __imp__GlobalAlloc@8
U __imp__GlobalLock@4
U __imp__GlobalUnlock@4
U __imp__MessageBoxA@16
U __imp__OpenClipboard@4
U __imp__SetClipboardData@8
00000000 T _CheckBroadcast@0
00000000 T _Inittpsetunsol@0
U _memcpy
U _memset
U _sprintf
U _tpchkunsol@0
U _tpsetunsol@4
00000000 T _vCSLMsgHandler@12
nm
output from MinGW compiler:
nm Release/broadc.o
00000000 b .bss
00000000 d .data
00000000 N .debug_abbrev
00000000 N .debug_aranges
00000000 N .debug_info
00000000 N .debug_line
00000000 N .debug_loc
00000000 r .eh_frame
00000000 r .rdata
00000000 t .text
00000104 T _CheckBroadcast@0
U _CloseClipboard@0
U _EmptyClipboard@0
U _GlobalAlloc@8
U _GlobalLock@4
U _GlobalUnlock@4
0000010c T _Inittpsetunsol@0
U _MessageBoxA@16
U _OpenClipboard@4
U _SetClipboardData@8
U _sprintf
U _tpchkunsol@0
U _tpsetunsol
00000000 T _vCSLMsgHandler@12
Edit: Looking at _tpsetunsol
symbol it is quite evident that MSVC and GCC produce different symbols.
GCC produces: U _tpsetunsol
and MSVC: U _tpsetunsol@4
Is there a way to have GCC produce same symbol than MSVC?
Edit2: output from nm wtuxws32.lib
(that is where tpsetunsol
is defined)
WTUXWS32.dll:
00000000 i .idata$4
00000000 i .idata$5
00000000 t .text
00000000 I __imp__tpsetunsol@4
U __IMPORT_DESCRIPTOR_WTUXWS32
00000000 T _tpsetunsol@4
Is this impossible to get to work with GCC? Thanks.