Mail Archives: cygwin/1996/12/04/21:01:53
David Highley[SMTP:dhighley AT halcyon DOT com] wrote:
>I'm trying to compile a simple program on a Win95 system to get around the
>broken cat command and I have not been able to resolve one undefined.
> WinMain AT 16
>
>This also leads me to think that gcc is defaulting to 16 bit mode. This is
>my first attempt to compile any program in the cygnus ported environment.
>I have done an nm on all libraries in the directory:
> H-i386-cygwin32/i386-cygwin32/lib
>
>Last I am using beta version 16. I need to be able to create command that
>will recombine split files. Thank you for any help you can provide.
WinMain AT 16 is the internal/pascalized name of WinMain. The 16 simply indicates
the number of bytes on the stack occupied by parameters, included so that the
called function can remove those parameters from the stack (instead of the
calling function as in "C" type calls).
There is magic in the gcc compiler, related to the attribute __stdcall__ I
think, that causes a call to WinMain to become a call to WinMain AT 16. So, what
is happening here is you do not have a properly prototyped WinMain in your
program.
Point 1: If your immediate response is "but I'm using main" then I am somewhat
puzzled. The only factoid I can add is that if Cygnus did the main/WinMain thing
the same way that I did in the Minimalist GNU-Win32 files (and I think they did)
then an unresolved reference to WinMain also indicates the fact that main is
missing from your program. It doesn't say unresolved reference to main because
it allows you to write apps that use WinMain as the entry point. First it checks
for main, then for WinMain. If neither is found it reports an unresolved reference
to WinMain.
Point 2: The easiest way to make sure that your WinMain is properly prototyped is
to copy the prototype from the windows32api-0.1.2 (or above?) header files (just
do a grep for WinMain in the windows32 header file directory).
I hope this helps you solve your problem. If not, perhaps the best option is to
work it down to the smallest set of source code that you think should work but
doesn't, and give us all a look at it.
Good luck,
Colin.
-- Colin Peters - colin AT bird DOT fu DOT is DOT saga-u DOT ac DOT jp
-- Saga University Dept. of Information Science
-- Fundamentals of Information Science
-- http://www.fu.is.saga-u.ac.jp/~colin/home.html
-
For help on using this list, send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".
- Raw text -