delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/10/29/06:50:19

From: colin AT bird DOT fu DOT is DOT saga-u DOT ac DOT jp (Colin Peters)
Subject: RE: Compiler
29 Oct 1997 06:50:19 -0800 :
Message-ID: <01BCE47B.72E8C8E0.cygnus.gnu-win32@gbird0>
Mime-Version: 1.0
To: "'Scott Warner'" <swarnerx3 AT acadia DOT net>
Cc: "'GNU-Win32'" <gnu-win32 AT cygnus DOT com>

Scott Warner[SMTP:swarnerx3 AT acadia DOT net] wrote:
>Thank you for your help.  Linking to the specific Windows libraries with
>-luser32 took care of most of the undefined references.  Still getting
>
>D:\gnuwin32\b18\H-i386-cygwin32\i386-cygwin32\lib/libcygwin.a(libcmain.o)(.t
>ext+0x1e):libcmain.cc: undefined reference to `WinMain AT 16'
>G__~1.EXE: Internal compiler error: program ld got fatal signal 1
>
>in a simple "Hello World!" type program.  Is there a command switch or
>environmental variable I am missing, or a library I am not linking?

This means, I think, that your WinMain is not prototyped/defined
"properly". It should look like this:

int STDCALL
WinMain (HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmd, int nShow)

Especially important is the STDCALL (WINAPI will also do I think)
which gets that @16 tacked onto the end of the function name
and makes it have the proper calling convention.

If that's not the problem then I'm afraid I don't know what's wrong.

Colin.

-- Colin Peters - Saga Univ. Dept. of Information Science
-- colin AT bird DOT fu DOT is DOT saga-u DOT ac DOT jp - finger for PGP public key
-- http://www.fu.is.saga-u.ac.jp/~colin/index.html
-- http://www.geocities.com/Tokyo/Towers/6162/

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


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