www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/07/06/18:48:43

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-ID: <3782874F.F317A97@visi.net>
Date: Tue, 06 Jul 1999 18:46:39 -0400
From: John Garrison <jeg AT visi DOT net>
X-Mailer: Mozilla 4.51 [en] (X11; I; Linux 2.2.5-15 i586)
X-Accept-Language: en
MIME-Version: 1.0
To: Mumit Khan <khan AT xraylith DOT wisc DOT EDU>
CC: cygwin AT sourceware DOT cygnus DOT com
Subject: Re: Libraries not working
References: <199907062223 DOT RAA00541 AT mercury DOT xraylith DOT wisc DOT edu>

Mumit Khan wrote:

> John Garrison <jeg AT visi DOT net> writes:
> >
> > Now if I could just find out how to make WinMain be declared without
> > breaking compatibility with other platforms.  Can I just do somthing like
> > the following?
> >
> > WinMain(void)
> > {
> > main();
> > }
> >
>
> You shouldn't need to do anything at all. If this is a windows32 GUI
> program, add -mwindows when linking the program; if this is a console
> mode (the usual Unix kind), then the linker should pick up main from
> one of the object files where main is defined.
>
> If it is console mode, then is main() defined in one of the object
> modules?
>
>   $ i586-mingw32-nm --print-file-name *.o | grep main
>
> do you see a defined symbol for main (there is a ' T ' before the
> symbol name if defined).
>
> If main() is in an archive instead, try the following:
>
>   $ i586-mingw32-gcc -o foo -Wl,-u,_main [rest of arguments]
>
> and see if that helps.
>
> Regards,
> Mumit

i586-mingw32-nm didn't show anything at all. But here is the source code below
and the command I use to compile it below that.  Note I have to use main()
instead of int main(), it has something to do with SDL. SDL will complain if
I use anything else.

#include "PowerPak/powerdraw.h"

main(int argc, char *argv[])
{
   /* Initialize the library */
   PD_Init();

   /* Initialize 640x480x16bpp graphics mode */
   PD_SetGFXMode(640, 480, 16, PD_DEFAULT);

   /* Draw a little cylindrical thingie */
   PD_Ellipse(Screen, 320, 100, 100, 50, PD_CreateColor(Screen, 0xFF, 0x00,
0x00));
   PD_Ellipse(Screen, 320, 220, 100, 50, PD_CreateColor(Screen, 0xFF, 0x00,
0x00));
   PD_Ellipse(Screen, 320, 220, 50, 25, PD_CreateColor(Screen, 0xFF, 0x00,
0x00));
   PD_Ellipse(Screen, 320, 380, 50, 25, PD_CreateColor(Screen, 0xFF, 0x00,
0x00));
   PD_VLine(Screen, 100, 220, 220, PD_CreateColor(Screen, 0xFF, 0x00, 0x00));
   PD_VLine(Screen, 100, 220, 420, PD_CreateColor(Screen, 0xFF, 0x00, 0x00));
   PD_VLine(Screen, 220, 380, 270, PD_CreateColor(Screen, 0xFF, 0x00, 0x00));
   PD_VLine(Screen, 220, 380, 370, PD_CreateColor(Screen, 0xFF, 0x00, 0x00));

   /* Wait for 5 seconds so you can see it */
   PD_Wait(5000);

   /* Cleanup */
   PD_Quit();
}

and here is the command to gcc.

 /usr/win32/bin/i586-mingw32-gcc ex1.c -lPD -lSDL -lttf -lIMG
-I/usr/win32/include


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


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