Compiling with cigwin

i am newby on this…
i have instaled cigwin on my win xp
i copy .lib files on C:\cygwin\lib and the include files on C:\cygwin\usr\include\SDL then i have a test.c program that do

#include "SDL.h"
int main()
{
return 0;
}

…i try to compile it…

CXX=g++
OPCIONES=-g -Wall -I…/util -I/usr/include/GL -I/bin -I/usr/include/w32api -I/usr/include/SDL -I/usr/include
DIRECTORIOS=
#BIBLIOTECAS=-L/lib -lm
BIBLIOTECAS=-L/lib -lSDL.lib -lSDLmain.lib -lglui -lglut32 -lglu32 -lopengl32 -lm

all:
${CXX} ${OPCIONES} test.c -o test ${DIRECTORIOS} ${BIBLIOTECAS}

…but…

test.c:1: SDL.h: No such file or directory
make: *** [all] Error 1

what should i do?
any documentation to suggest?

thanks

Hi :slight_smile:

i am newby on this…
i have instaled cigwin on my win xp
i copy .lib files on C:\cygwin\lib and the include files on
C:\cygwin\usr\include\SDL then i have a test.c program that do

#include “SDL.h”

Try
#include <SDL/SDL.h>

This works fine for me.
If you use your #include you should add the SDL-Include directory to
your compiler flags
(-I)

what should i do?
any documentation to suggest?

thanks

HTH,
HaukeAm Fre, 2003-03-28 um 18.31 schrieb Federico Berardi:

“Wir sind der Nato fest verpflichtet. Wir sind ein Teil der Nato.
Wir sind Europa fest verpflichtet. Wir sind ein Teil Europas”
(George W. Bush)

#include <SDL.h>

if the header is given with quotes then it looks for it in the current
directory. if its in < and > characters, then it looks in the include paths.

Federico Berardi wrote:> #include “SDL.h”

int main()
{
return 0;
}

I use sdl-config to give me the right parameters

sdl-config --cflags for the header files
sdl-config --libs for the libraries

Hope this helps,
Rob

It works with my setup (Cygwin on WinXP, SDL compiled from source):
$ cat Makefile
CXX=gcc
OPCIONES=-g -Wall sdl-config --cflags
DIRECTORIOS=
BIBLIOTECAS=sdl-config --libs

all:
${CXX} -o bozo.exe bozo.c ${OPCIONES} ${BIBLIOTECAS}

$ cat bozo.c
#include "SDL.h"
int main(int argc, char** argv)
{
return 0;
}

Note that SDL libs are in E:\Cygwin\usr\local\lib and SDL includes in
E:\Cygwin\usr\local\include\SDL.

Best Regards,
^IoDream^> ----- Original Message -----

From: Federico Berardi
To: SDL at libsdl.org
Sent: Friday, March 28, 2003 6:31 PM
Subject: [SDL] compiling with cigwin

i am newby on this…
i have instaled cigwin on my win xp
i copy .lib files on C:\cygwin\lib and the include files on
C:\cygwin\usr\include\SDL then i have a test.c program that do

#include "SDL.h"
int main()
{
return 0;
}

…i try to compile it…

CXX=g++
OPCIONES=-g -Wall -I…/util -I/usr/include/GL -I/bin -I/usr/include/w32api -
I/usr/include/SDL -I/usr/include
DIRECTORIOS=
#BIBLIOTECAS=-L/lib -lm
BIBLIOTECAS=-L/lib -lSDL.lib -lSDLmain.lib -lglui -lglut32 -lglu32 -lopengl3
2 -lm

all:
${CXX} ${OPCIONES} test.c -o test ${DIRECTORIOS} ${BIBLIOTECAS}

…but…

test.c:1: SDL.h: No such file or directory
make: *** [all] Error 1

what should i do?
any documentation to suggest?

thanks


Envie de discuter en “live” avec vos amis ? T?l?charger MSN Messenger
http://www.ifrance.com/_reloc/m la 1?re messagerie instantan?e de France

i am not include SDL.h using the directory (SDL/SDL.h) because i include the
directory with -I/usr/include/SDL
thanks anyway> ----- Original Message -----

From: hzuehl@athene.dnsalias.org (Hauke Joachim Zuehl)
To:
Sent: Friday, March 28, 2003 3:15 PM
Subject: Re: [SDL] compiling with cigwin

Hi :slight_smile:

Am Fre, 2003-03-28 um 18.31 schrieb Federico Berardi:

i am newby on this…
i have instaled cigwin on my win xp
i copy .lib files on C:\cygwin\lib and the include files on
C:\cygwin\usr\include\SDL then i have a test.c program that do

#include “SDL.h”

Try
#include <SDL/SDL.h>

This works fine for me.
If you use your #include you should add the SDL-Include directory to
your compiler flags
(-I)

what should i do?
any documentation to suggest?

thanks

HTH,
Hauke

“Wir sind der Nato fest verpflichtet. Wir sind ein Teil der Nato.
Wir sind Europa fest verpflichtet. Wir sind ein Teil Europas”
(George W. Bush)


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


www.Argentina.com
E-mail Profesional y Acceso a Internet UltraVeloz totalmente GRATIS en
Buenos Aires, Rosario, Cordoba, Mendoza, Mar del Plata, Moreno, Merlo,
La Plata, Pilar, Escobar, Campana y Z?rate

At 01:24 PM 28/03/2003 -0500, you wrote:

#include <SDL.h>

if the header is given with quotes then it looks for it in the current
directory. if its in < and > characters, then it looks in the include paths.

I’ve got a similar problem with my compiler not finding some files - how do
you specify include paths? Is there a way other than using command line
options?

Thanks.

squigger

My home page - http://www.hotkey.net.au/~jasonjob

Utter damnation upon, those who mangle and misuse comma’s and, apostrophes’

At 06:41 PM 28/03/2003 +0100, you wrote:

I use sdl-config to give me the right parameters

sdl-config --cflags for the header files
sdl-config --libs for the libraries

What’s the windows equivalent of this?

Thanks.

squigger

My home page - http://www.hotkey.net.au/~jasonjob

Utter damnation upon, those who mangle and misuse comma’s and, apostrophes’

At 06:41 PM 28/03/2003 +0100, you wrote:

I use sdl-config to give me the right parameters

sdl-config --cflags for the header files
sdl-config --libs for the libraries

What’s the windows equivalent of this?

If you’re using make and cygwin, that’s exactly what you use. In
your Makefile, something like:

CFLAGS:=sdl-config --cflags
LIBS:=sdl-config --libs

List of .o files in your program.

OBJS:=main.o foo.o

The program.

my_project.exe: $(OBJS)
gcc $(CFLAGS) $(LIBS) -o my_project.exe $(OBJS)

Convert .c to .o

.c.o:
gcc $(CFLAGS) -c -o $@ $<–
Chris Herborth (@Chris_Herborth)
Otaku no sensei