Installing mingw and SDL

Having given up on SDL and assembler, and SDL and LCC, I’m trying to use mingw.
I installed MSYS 1.0.8 and mingw according to
http://www.libsdl.org/extras/win32/mingw32/README.txt. Then I unzipped the SDL
1.2.5 source code to a directory under my HOME in msys, and installed it with
./configure && make && make install. All seemed to go ok as far as I know.

I created ~/sdl_1 to write a test program and copied SDL.dll into it. Test
program was:

#include <stdio.h>
#include "SDL.h"
main()
{
printf(“Hello world\n”);
return 0;
}

Gcc complains with “SDL.h: No such file or directory”. Any ideas what else I
need to do beyond the installation instructions in the above README?

Thanks in advance.

Having given up on SDL and assembler, and SDL and LCC, I’m trying to use mingw.
I installed MSYS 1.0.8 and mingw according to
http://www.libsdl.org/extras/win32/mingw32/README.txt. Then I unzipped the SDL
1.2.5 source code to a directory under my HOME in msys, and installed it with
./configure && make && make install. All seemed to go ok as far as I know.

I created ~/sdl_1 to write a test program and copied SDL.dll into it. Test
program was:

#include <stdio.h>
#include "SDL.h"
main()
{
printf(“Hello world\n”);
return 0;
}

Gcc complains with “SDL.h: No such file or directory”. Any ideas what else I
need to do beyond the installation instructions in the above README?

I think with most SDL-dev installations, you have to #include
"SDL/SDL.h", don’t quote me on it though. And perhaps you should check
to see wether you have the respective dev packages installed on your
system.

cheers
JamesOn Mon, Nov 25, 2002 at 08:54:04AM +0000, James Eibisch wrote:

Thanks in advance.


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

I installed MSYS 1.0.8 and mingw according to
http://www.libsdl.org/extras/win32/mingw32/README.txt. Then I unzipped the SDL
1.2.5 source code to a directory under my HOME in msys, and installed it with
./configure && make && make install. All seemed to go ok as far as I know.

I created ~/sdl_1 to write a test program and copied SDL.dll into it. Test
program was:

#include <stdio.h>
#include "SDL.h"
main()
{
printf(“Hello world\n”);
return 0;
}

Gcc complains with “SDL.h: No such file or directory”. Any ideas what else I
need to do beyond the installation instructions in the above README?

Yes, you need to use the output of “sdl-config --cflags” as compiler flags.

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

James wrote:

I installed MSYS 1.0.8 and mingw according to
http://www.libsdl.org/extras/win32/mingw32/README.txt. Then I
unzipped the SDL 1.2.5 source code to a directory under my HOME
in msys, and installed it with ./configure && make && make install.
All seemed to go ok as far as I know.

I created ~/sdl_1 to write a test program and copied SDL.dll into it.
Test program was:

#include <stdio.h>
#include "SDL.h"
main()
{
printf(“Hello world\n”);
return 0;
}

Gcc complains with “SDL.h: No such file or directory”. Any ideas what
else I need to do beyond the installation instructions in the above
README?

Sam replied:

Yes, you need to use the output of “sdl-config --cflags” as compiler
flags.

Thanks Sam. Looking at the archives I see this has been asked before.
Adding the sdl-config line doesn’t make gcc happy, though. With the
above program and compiling with:

gcc sdl_1.c -o sdl_1.exe ‘sdl-config --cflags’

I get:

sdl_1.c:2:17: SDL.h: No such file or directory
gcc.exe: sdl-config --cflags: No such file or directory

So it looks like gcc isn’t interpreting ‘sdl-config…’ properly,
perhaps (I’m no expert). I get the ‘SDL.h: No such file…’ error
regardless of whether I include “SDL.h” or include “SDL/SDL.h”.

I can run sdl-config --cflags from the MSYS shell and it gives:

-I/usr/local/include/SDL -Dmain=SDL_main

In the directory /local/include/SDL immediately under my MSYS directory
are 28 .h files including SDL.h.

My directory structure is as follows (I assume this is similar to what
everyone else has):

c:\blah\mingw\ ;what I created to put all mingw stuff in

MSYS directories:

c:\blah\mingw\1.0
c:\blah\mingw\1.0\bin
c:\blah\mingw\1.0\doc
c:\blah\mingw\1.0\etc\ ;in here is my fstab with my /mingw mount
c:\blah\mingw\1.0\home\ ;my home dir with my source code
c:\blah\mingw\1.0\local
c:\blah\mingw\1.0\local\bin\ ;sdl-config is here
c:\blah\mingw\1.0\local\include\ ;empty except for SDL dir
c:\blah\mingw\1.0\local\include\SDL ;28 .h files including SDL.h
c:\blah\mingw\1.0\local\lib\ ;SDL.dll is here
c:\blah\mingw\1.0\local\man
c:\blah\mingw\1.0\local\share
c:\blah\mingw\1.0\mingw\ ;empty
c:\blah\mingw\1.0\uninstall
c:\blah\mingw\1.0\msys.bat ;I start the shell with this

mingw directories:

c:\blah\mingw\mingw
c:\blah\mingw\mingw\bin\ ;gcc and mingw32-make.exe are here
c:\blah\mingw\mingw\doc
c:\blah\mingw\mingw\home\ ;empty
c:\blah\mingw\mingw\include\ ;lots of files but nothing SDL
c:\blah\mingw\mingw\lib
c:\blah\mingw\mingw\mingw\ ;empty
c:\blah\mingw\mingw\mingw32
c:\blah\mingw\mingw\uninstall\

Thanks a lot for any help,
James

Yes, you need to use the output of “sdl-config --cflags” as compiler
flags.

Thanks Sam. Looking at the archives I see this has been asked before.
Adding the sdl-config line doesn’t make gcc happy, though. With the
above program and compiling with:

gcc sdl_1.c -o sdl_1.exe ‘sdl-config --cflags’

You wanted backtics; ``, not ‘’.

However, if you’re compiling at a cmd/command prompt and not with bash,
that won’t work; you need to insert the output of the command yourself.

sdl_1.c:2:17: SDL.h: No such file or directory
gcc.exe: sdl-config --cflags: No such file or directory

So it looks like gcc isn’t interpreting ‘sdl-config…’ properly,
perhaps (I’m no expert). I get the ‘SDL.h: No such file…’ error
regardless of whether I include “SDL.h” or include “SDL/SDL.h”.

It’s notation that a Unix shell interprets, not GCC.On Tue, Nov 26, 2002 at 09:53:43AM +0000, James Eibisch wrote:


Glenn Maynard