Question on mingw32 native builds

Has anyone had any success doing native win32 builds using
mingw32? (As opposed to xdev using mingw32 under Linux.)

I’m having all sorts of problems, I fix one thing and another
shows up… suggesting that there is something more fundemental
that I’ve not set up properly.

I had originally started with SDL, trying to build the 1.1 libs,
without success, backed off that to just try to build the 1.0 test
programs, configure is broken, so I built a makefile by hand,
solved a bunch of linker problems, but the exe is SEGVing on me.

I can give more details if there isn’t a magic bullet. :slight_smile:

I use mingw32 to do native windows builds. Works just
fine for me, tell us the errors you are getting. I’m
sure someone here can help you__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.

Okay, the history:

I’m using mingw32 and the MKS tools as my environment. I’d been
working with DirectX successfully.

I haven’t been able to use configure, so I hand crafted a makefile.

My first list of libs was:
-lSDL -lSDLmain -lm

The link reports:
…lib\libmingw32.a(main.o): Undefined reference to ‘WinMain at 16’

I’m confused by this since SDLmain is on the link line… but I
modified the makefile to use:
-nostdlib $(MINGLIBDIR)/crt2.o -lmingw32 -lSDL -lSDLmain
-lkernel32 -luser32 -lmsvcrt -lm

The link reports:
…main/SDL_main.c:123: undefined reference to ‘_alloca’

I went hunting for alloca but wasn’t able to find it. I wrote
a replacement for it, using malloc, which didn’t work. (I thought
that it SHOULD work, although there would be a memory leak.)
The docs say it should be in msvcrt, but all the "alloc"s I see
are realloc, malloc, and calloc… no alloca.

Here, I’m kinda stuck.

Any suggestions?–
“Though you die, La Resistance lives on” - SP:BL&U

the libs should be
-lmingw32 -lSDLmain -lSDL -lwinmm -ldxguid
in that order too and that should work for you, works
great for me. I had the same problems when first
starting up with mingw32 and SDL. If it still doesnt
work just let the people her know, they’re a bunch of
smart cookies.

Jared__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.

-DWIN32 is also helpful.On 26 Feb 2000 19:56:54 -0800, Jared <slake.geo at yahoo.com> wrote:

the libs should be
-lmingw32 -lSDLmain -lSDL -lwinmm -ldxguid
in that order too and that should work for you, works

Thanks Jared & jbaumg2. That was the “magic bullet” I was looking
for! :)–
“Though you die, La Resistance lives on” - SP:BL&U