How can I export atexit and puts?

Stefan Dösinger stefandoesinger at gmail.com
Fri May 3 09:29:45 CDT 2019


> Hi, I am trying to export atexit and puts using wine, I wrote a spec file, libwinecompat.spec with the following:
> 
> @ cdecl atexit(ptr) MSVCRT_atexit
> @ cdecl puts(str) MSVCRT_puts
> 
> _________________________________________________________________________
> 
> I build an ar archive with:
> 
> winebuild --implib -o libwinecompat.a -E libwinecompat.spec
I am not entirely sure of these things myself, but I am surprised you don't get an error at this point. If you want to export a forward then I htink you'll have to write msvcrt.atexit instead of "MSVCRT_atexit".

However, I recommend loading Wine's msvcrt at runtime with LoadLibrary and retrieving the symbols with GetProcAddress. Otherwise you'll have a mess on your hand to make sure you don't accidentally call the Linux or OSX libc instead.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Message signed with OpenPGP
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20190503/26107566/attachment.sig>


More information about the wine-devel mailing list