Utilisation d'un makefile
adeline11
Messages postés
58
Statut
Membre
-
SylvetteTech -
SylvetteTech -
Bonjour,
Je voudrais utiliser un makefile mais j'utilise la SDL dans mon programme. Je ne sais pas du tout comment faire.
Mon makefile:
CC=g++ -I/usr/include/SDL -L/usr/lib
LDFLAGS = `sdl-config --cflags --libs` -lSDLmain -lSDL -lSDL_image -lSDL_ttf
OBJETS= Fonctions.o Main.o
TARGET= Pong
$(TARGET) : $(OBJETS)
$(CC) $(OBJETS) -o $(TARGET)
$(CXX) $^ -o $@ $(LDFLAGS)
Tableau.o : Fonctions.cc Fonctions.h
$(CC) -c Fonctions.cc
Main.o : Main.cc Fonctions.h
$(CC) -c Main.cc
clean :
rm -f *~ *.o $(TARGET)
# DO NOT DELETE
L'erreur affichée dans le terminal:
Fonctions.cc: In function «SDL_Surface* loadImage(std::string)»:
Fonctions.cc:29: erreur: «IMG_Load» was not declared in this scope
Fonctions.cc: In function «SDL_Surface* loadImageWithColorKey(std::string, int, int, int)»:
Fonctions.cc:38: erreur: «IMG_Load» was not declared in this scope
make: *** [Fonctions.o] Erreur 1
merci d'avance pour votre aide!!
Je voudrais utiliser un makefile mais j'utilise la SDL dans mon programme. Je ne sais pas du tout comment faire.
Mon makefile:
CC=g++ -I/usr/include/SDL -L/usr/lib
LDFLAGS = `sdl-config --cflags --libs` -lSDLmain -lSDL -lSDL_image -lSDL_ttf
OBJETS= Fonctions.o Main.o
TARGET= Pong
$(TARGET) : $(OBJETS)
$(CC) $(OBJETS) -o $(TARGET)
$(CXX) $^ -o $@ $(LDFLAGS)
Tableau.o : Fonctions.cc Fonctions.h
$(CC) -c Fonctions.cc
Main.o : Main.cc Fonctions.h
$(CC) -c Main.cc
clean :
rm -f *~ *.o $(TARGET)
# DO NOT DELETE
L'erreur affichée dans le terminal:
Fonctions.cc: In function «SDL_Surface* loadImage(std::string)»:
Fonctions.cc:29: erreur: «IMG_Load» was not declared in this scope
Fonctions.cc: In function «SDL_Surface* loadImageWithColorKey(std::string, int, int, int)»:
Fonctions.cc:38: erreur: «IMG_Load» was not declared in this scope
make: *** [Fonctions.o] Erreur 1
merci d'avance pour votre aide!!
A voir également:
- Utilisation d'un makefile
- Utilisation chromecast - Guide
- Télécharger gratuitement notice d'utilisation - Guide
- La ressource demandée est en cours d'utilisation - Forum Téléphones & tablettes Android
- Logiciel en Cours d'utilisation ? ✓ - Forum Logiciels
- Imprimante en cours d'utilisation ✓ - Forum Matériel & Système