www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/06/13/05:09:48

From: "A.Appleyard" <A DOT APPLEYARD AT fs2 DOT mt DOT umist DOT ac DOT uk>
Organization: Materials Science Centre
To: DJGPP AT delorie DOT com
Date: Thu, 13 Jun 1996 09:58:02 GMT
Subject: Re: RSX funny: mangled versus unmangled forms of a name
Message-ID: <2CE08D74ADB@fs2.mt.umist.ac.uk>

  I have go32 1.12 binutils 2.4 diffutils 2.6 flex 2.4.7 gas 2.3 gcc 2.6.0 gdb
4.12 gzip 1.2.4 libg++-2.6.0 make-3.71 patch-2.1 sed-1.18 texinfo-3.10
  I tried to compile using djgpp and RSX this beginner's Windows program
(which I call T$_.CC) that I typed in from a book that I bought:-

#define int short
#include <windows.h>
/*-----*/
int WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR command, int n){
WinExec("NOTEPAD.EXE",SW_SHOWNORMAL); return 1;}

  I did everything that the file \RSXWDK\DOC\RSXWDK.HLP told me to.
  I compiled T$_.CC under plain DOS, not Windows or the Windows DOS box.
  When I compiled it, I got this fault remark:-

C:\RSXWDK>gcc t$_.cc -win -o a.w32
rsxw32.c(.text+0x137): undefined reference to `WinMain'

  I have finally compiled it, by direct surgery on the intermediate *.s file:-
  gcc t$_.cc -win -S
  In the resulting T$_.s file, replace these two lines:-

.globl _WinMain__FUsUsPci
_WinMain__FUsUsPci:

  by

.globl _WinMain
_WinMain:

  gcc t$_S -win -o a.w32
  \rsxwdk\rswxbind.exe a.w32 t$_.exe

  and T$_.EXE ran as a Windows application as expected!!!
  (1) How to do this under djgpp version 2?
  (2) How to tell gcc not to mangle the function name `WinMain' when compiling
t$_.cc? Or how to tell djgpp's linker to treat _WinMain__FUsUsPci as
equivalent to _WinMain ?

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019