Wine Forums

Board index » WineHQ » Wine Help » Linux

 Page 1 of 1 [ 1 post ] 

Author Message
 Post Posted: Thu Apr 18, 2019 9:40 am 

Joined: Thu Apr 18, 2019 9:33 am
Posts: 1
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 then test using this program ...

/* atexit example */
#include <stdio.h>      /* puts */
#include <stdlib.h>     /* atexit */

void fnExit1 (void)
  puts ("Exit function 1.");

void fnExit2 (void)
  puts ("Exit function 2.");

int main ()
  atexit (fnExit1);
  atexit (fnExit2);
  puts ("Main function.");
  return 0;

(it's from which I will plug ... [thanks])

...And compile with

sudo mv /usr/i686-w64-mingw32/lib/libmsvcrt.a /usr/i686-w64-mingw32/lib/libmsvcrt.a.old
i686-w64-mingw32-gcc -nostdlib test.c -lmsvcrt -L. -lwinecompat
sudo mv /usr/i686-w64-mingw32/lib/libmsvcrt.a.old /usr/i686-w64-mingw32/lib/libmsvcrt.a

I know mingw's msvcrt is not linked and wine's msvcrt is. Unfortuately I still get the following errors:

undefined reference to `puts'
undefined reference to `atexit'

Any help much appreciated

Display posts from previous:  Sort by  
 Page 1 of 1 [ 1 post ] 

Board index » WineHQ » Wine Help » Linux

Who is online

Users browsing this forum: No registered users and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: