Problème d'édition de lien
Bonjours à tous :coucou:
J'ai un petit problème de compilation que je ne comprends pas 8O
Enfin si je comprend la signification mais pas le pourquoi.
Je suis sous Windows et j'utilise l'IDE CodeBlock et j'ai comme erreur :
Code:
1 2 3 4 5 6 7 8 9 10 11 12
| Project : SDL Application
Compiler : GNU GCC Compiler (called directly)
Directory : ******
--------------------------------------------------------------------------------
Switching to target: default
Compiling: jeu.c
Compiling: main.cpp
Linking console executable: SDLapp.exe
.objs\main.o:main.cpp:(.text+0x1cc): undefined reference to `jouer(SDL_Surface*)'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings |
Voici le code de mon main et ce qui se rapporte avec ma fonction jouer :
( Code TRÈS allégé ! )
Code:
1 2 3 4 5 6 7 8 9 10
|
#include "constantes.h"
#include "jeu.h"
int main ( int argc, char** argv ){
SDL_Surface *ecran = NULL;
ecran=IMG_Load("menu.jpg");
jouer(ecran);
} |
Code:
1 2 3 4 5 6
| #ifndef DEF_JEU
#define DEF_JEU
void jouer(SDL_Surface *ecran);
#endif |
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
#include <stdlib.h>
#include <stdio.h>
#include <SDL/SDL.h>
#include <SDL/SDL_image.h>
#include "constantes.h"
#include "fichier.h"
#include "jeu.h"
void jouer(SDL_Surface *ecran){
// bla bla bla
} |
Voila si quelqu'un à des idées concernant cette erreur, il est le bienvenu :D