[SDL] Re: SDL Install/Build problem with MingW & MSys

Atrix Wolfe atrix2 at cox.net
Thu Jan 30 15:58:01 PST 2003


using info from the FAQ, heres a simple sample makefile(Dr. Seuss shoulda
written programming books), this is what i do and it works for me in msys w/
mingw:

SDL_CFLAGS := $(shell sdl-config --cflags)
SDL_LDFLAGS := $(shell sdl-config --libs)

All: main.cpp
    g++ -o main.exe main.cpp ${SDL_CFLAGS} ${SDL_LDFLAGS}


----- Original Message -----
From: "TomR" <trowt at directlink.net>
To: <sdl at libsdl.org>
Sent: Thursday, January 30, 2003 3:30 PM
Subject: Re: [SDL] Re: SDL Install/Build problem with MingW & MSys


> Continuing the saga...
>
> I found a tutorial site that had an extremely simple first program, just
to
> ensure you had everything installed correctly...
>
> #include "SDL.h"
> int main ( int argc , char* argv [] )
> {
>   cout << "Howdy!";
>   return ( 0 ) ;
> }
>
>
>
> Pretty simple, but it took me a full day to get it working simply due to
> unfamiliarity with gcc.
> First, I tried Bloodshed's Dev-C++, but kept getting a 'makefile' error -
> something about an invalid separator or somesuch.
> Then I decided to just go CLI with no frills, which kept giving me the
> dreaded 'Undefined reference to WinMain at 16' error, which is apparently
> extremely common, as google had pages and pages of hits for that search
> term.
>
>
> I finally stumbled upon the answer, which was to use the output of
> 'sdl-config --libs' (I believe), as parameters for g++. It worked, even
> though I copied what the forum reply said, instead of actually checking
what
> my sdl-config returned, modifying for paths.
>
>
> So, for anyone else that's truly a newbie and having similar problems, for
> the above program, you need g++/gcc statements that look similar to....
>
>
> $ g++ -c main.cpp -o main.o -I"C:/mingw/include/SDL"
> $ g++ main.o test1_private.res -o
> "test1.exe" -L"C:/mingw/lib/SDL" -lmingw32 -lSDLmain -lSDL -mwindows
>
>
> ...you can probably ignore 'test1_private.res' - that came from Dev-C++
> letting me give the program an icon.
>
> Anyway, I'm on to trying a "real" test app now that I have figured out how
> to compile such that SDL is actually part of the app... I hope.
>
> Thanks again to those that responded!
>
>
> ----- Original Message -----
> From: "Atrix Wolfe" <atrix2 at cox.net>
> To: <sdl at libsdl.org>
> Sent: Thursday, January 30, 2003 4:10 PM
> Subject: Re: [SDL] Re: SDL Install/Build problem with MingW & MSys
>
>
> > power to ya, im doing the same thing and in fact for the same reason.
> When
> > i installed for me it just worked so i didnt know how to help you
trouble
> > shoot.  Glad that its working better for you now.
> >
> > ----- Original Message -----
> > From: "TomR" <trowt at directlink.net>
> > To: <sdl at libsdl.org>
> > Sent: Thursday, January 30, 2003 7:09 AM
> > Subject: Re: [SDL] Re: SDL Install/Build problem with MingW & MSys
> >
> >
> > > Thanks for the reply!
> > > I've used CygWin in the past and was trying MSys/MingW because all I
> > really
> > > need is GCC... I've got MSVC++ 5, but wanted to try GCC to get away
from
> > the
> > > hand-holding of MS.
> > >
> > > As noted in my self-reply, I feel the SDL docs are not at all newbie
> > > friendly, even to someone that's done other kinds of programming
before.
> > >
> > > Maybe I just expected too much of the existing docs.
> > >
> > >
> > > Thanks again!
> > >
> > > ----- Original Message -----
> > > From: "Calvin Spealman" <calvin at ironfroggy.com>
> > > To: <sdl at libsdl.org>
> > > Sent: Thursday, January 30, 2003 7:49 AM
> > > Subject: [SDL] Re: SDL Install/Build problem with MingW & MSys
> > >
> > >
> > > > I think you would have better luck with cygwin, which uses MingW,
but
> > > > also includes a more complete UNIX set of tools which help a lot.
> > > >
> > > > TomR wrote:
> > > > > Hi all!
> > > > > Big-time newb here, so please bear with me.
> > > > >
> > > > > I'm having no luck getting SDL to install/build on my system.
> > > > > Info:
> > > > > WindowsXP Home
> > > > > MingW32  2.0.0.3 (from Latest Releases at
> > > > > http://www.mingw.org/download.shtml )
> > > > > MSys  1.0.8 (from Latest Releases at
> > > http://www.mingw.org/download.shtml )
> > > > > SDL  1.2.5a (Win32 Development Library
> SDL-devel-1.2.5a-mingw32.tar.gz
> > > from
> > > > > http://www.libsdl.org/download-1.2.php )
> > > > >
> > > > >
> > > > > What I did:
> > > > > I installed MingW32 to c:\mingw
> > > > > I installed MSys to c:\msys
> > > > > --Msys install routine apparently found MingW, as my /etc/fstab
> > already
> > > has
> > > > > "c:/mingw mingw" set up.
> > > > > I unzipped the SDL archive to /home/[username]/SDL
> > > > > After getting an error, I found
> > > http://www.libsdl.org/extras/win32/gcc.html
> > > > > I used the "Native win32 for MingW build environment, BUT...
> > > > > --Since I already had MingW installed and mounted and in my Win32
> > PATH,
> > > Step
> > > > > 3 seemed unnecessary
> > > > > --Step 4 - There is _no_ /mingw/bin/make.exe - just the
> > > mingw32-make.exe -
> > > > > so I can't do this step
> > > > > --Step 5 - Having already unzipped SDL-devel-1.2.5a-mingw32.tar.gz
> to
> > > > > /home/[username]/SDL, I tried running
> > > > > ---- "./configure && make && make install" as directed with the
> > > following
> > > > > output and error (dashes added)
> > > > > --------$ ./configure && make && make install
> > > > > --------loading site script /etc/config.site
> > > > > --------loading cache ./config.cache
> > > > > --------checking host system type... i686-pc-mingw32
> > > > > --------checking target system type... i686-pc-mingw32
> > > > > --------checking for a BSD compatible install... /bin/install -c
> > > > > --------checking whether build environment is sane... yes
> > > > > --------checking whether make sets ${MAKE}... yes
> > > > > --------checking for working aclocal... missing
> > > > > --------checking for working autoconf... missing
> > > > > --------checking for working automake... missing
> > > > > --------checking for working autoheader... missing
> > > > > --------checking for working makeinfo... found
> > > > > --------checking for gcc... gcc
> > > > > --------checking whether the C compiler (gcc  ) works... yes
> > > > > --------checking whether the C compiler (gcc  ) is a
> cross-compiler...
> > > no
> > > > > --------checking whether we are using GNU C... yes
> > > > > --------checking whether gcc accepts -g... yes
> > > > > --------checking for working const... yes
> > > > > --------checking for sdl-config... no
> > > > > --------checking for SDL - version >= 1.2.3... no
> > > > > --------*** The sdl-config script installed by SDL could not be
> found
> > > > > --------*** If SDL was installed in PREFIX, make sure PREFIX/bin
is
> in
> > > > > --------*** your path, or set the SDL_CONFIG environment variable
to
> > the
> > > > > --------*** full path to sdl-config.
> > > > > --------configure: error: *** SDL version 1.2.3 not found!
> > > > >
> > > > >
> > > > > Now, I'm sure I've just made a really silly newb mistake...
> > > > > ... if I could just get someone to point out what that is, I'd be
> > > eternally
> > > > > greatful.
> > > > > Hopefully I've included enough details, but if not, I'll be happy
to
> > > include
> > > > > any other details you might need.
> > > > >
> > > > > Thanks in advance!
> > > > > TomR
> > > >
> > > >
> > > >
> > > > _______________________________________________
> > > > SDL mailing list
> > > > SDL at libsdl.org
> > > > http://www.libsdl.org/mailman/listinfo/sdl
> > > >
> > >
> > >
> > > _______________________________________________
> > > SDL mailing list
> > > SDL at libsdl.org
> > > http://www.libsdl.org/mailman/listinfo/sdl
> >
> >
> > _______________________________________________
> > SDL mailing list
> > SDL at libsdl.org
> > http://www.libsdl.org/mailman/listinfo/sdl
> >
>
>
> _______________________________________________
> SDL mailing list
> SDL at libsdl.org
> http://www.libsdl.org/mailman/listinfo/sdl





More information about the SDL mailing list