delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/07/23:55:35

From: tanph AT bj DOT col DOT com DOT cn
Comments: Authenticated sender is <tanph AT mh DOT bj DOT col DOT com DOT cn>
To: djgpp AT delorie DOT com
Date: Wed, 8 Oct 1997 11:44:40 +0000
MIME-Version: 1.0
Subject: RSXNTDJ 1.3.1
References: <Pine DOT OSF DOT 3 DOT 95 DOT 971007081054 DOT 19645C-100000 AT leonis DOT nus DOT sg>
In-reply-to: <Pine.SUN.3.91.971007144450.25685M-100000@is>
Message-Id: <343af5430252002@bj.col.com.cn>

I want to do Win32 programming using DJGPP, so I downloaded RSXNTDJ 
1.3.1 and  installed it  according to its installation guidance. 

Using "gcc -Zwin32 test.c -o test.exe",  I can compile and link and 
run the following test program successfully.

/* test.c */
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE 
hPrevInstance, LPSTRlpCmdLine, int nCmdShow)
{
  MessageBox (NULL, "Hello Win32", "First App", MB_OK);  
  return 0;
}

But, for the non-Win32 file x.c below,

/* x.c */
int x()
{
/* empty */
}

I use "gcc -o x.exe x.c" to compile and link it. It weirdly gives 
no error message and  generates the executable x.exe. Surely, this is 
wrong, for there is no main() at all.

Can anyone give me an explanation? 
Thanks in advance.

P.H. Tan

- Raw text -


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