# Link errors with mingw32 on Win98 - SOLVED

**URL:** <https://discourse.libsdl.org/t/link-errors-with-mingw32-on-win98-solved/2601>\
**Category:** SDL Development\
**Created:** [June 10, 2000, 10:39am UTC](https://discourse.libsdl.org/t/link-errors-with-mingw32-on-win98-solved/2601 "2000-06-10T10:39:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kinetik\_at\_paradise](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/k/4af34b/32.png) [@kinetik\_at\_paradise](https://discourse.libsdl.org/u/kinetik_at_paradise)\
**Post date:** [June 10, 2000, 10:39am UTC](https://discourse.libsdl.org/t/link-errors-with-mingw32-on-win98-solved/2601/1 "2000-06-10T10:39:08Z")

</div>

> The Windows version of SDL was compiled under Linux using  
> a cross-compiler  
> [http://www.libsdl.org/Xminw32/](http://www.libsdl.org/Xminw32/) so you can use configure,  
> since mingw32 lacks a  
> good damn bash !

I see, that makes sense, thanks. 🙂

> Anyway, try something like that :  
> “gcc -o yourexe -mwindows  
> yourobjectfiles.o -lmingw32 -lSDLmain -lSDL -luser32  
> -lgdi32 -lwinmm -ldxguid”

I had to add -I…/include/SDL, and I told it the C  
source file rather than the object file, but that works. In  
fact, I can drop user32, gdi32, winmm and dxguid and it  
still works.

> It’s surely a problem of library precedence, you have to  
> put -lmingw32 -lSDLmain -lSDL in that order.

What it appears to be, is the positioning of the source  
file I’m compiling in the argument list. For example:

gcc -I…/include/SDL -o a.exe -mwindows sdltest.c -lmingw32  
-lSDLmain -lSDL

…works fine, but:

gcc -I…/include/SDL -o a.exe -mwindows -lmingw32 -lSDLmain  
-lSDL sdltest.c

…fails, with the linker error I mentioned in an earlier  
message.

Thank you very much for solving the problem. 🙂

Another question, is where do I find the  
opengl32.lib/glu32.lib and associated includes for mingw32

- I’ve looked around the SDL website but I can’t find any  
mention of a location to grab them from.

Thanks again.

---

<div class="post-metadata">

**Author:** ![Herve\_PARISSI](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/h/8491ac/32.png) [@Herve\_PARISSI](https://discourse.libsdl.org/u/Herve_PARISSI)\
**Post date:** [June 11, 2000, 7:44am UTC](https://discourse.libsdl.org/t/link-errors-with-mingw32-on-win98-solved/2601/2 "2000-06-11T07:44:40Z")

</div>

> > Thank you very much for solving the problem. 🙂
> 
> You’re welcome 😉
> 
> > Another question, is where do I find the  
> > opengl32.lib/glu32.lib and associated includes for mingw32
> 
> libopengl32.a and libglu32.a are included in mingw32 but strangely  
> not the include files !  
> Take a look at [GCC Win32 Build Environment](http://www.libsdl.org/Xmingw32) and grab  
> [http://www.libsdl.org/Xmingw32/opengl-cross.tar.gz](http://www.libsdl.org/Xmingw32/opengl-cross.tar.gz)
> 
> > - I’ve looked around the SDL website but I can’t find any  
> > mention of a location to grab them from.
> > 
> > Thanks again.
> 
> Herve
> 
> > ----- Original Message -----  
> > From: kinetik@paradise.net.nz ()  
> > To:   
> > Sent: Saturday, June 10, 2000 12:39 PM  
> > Subject: Re: [SDL] Link errors with mingw32 on Win98 - SOLVED
