Bonjour,
Je souhaite diviser mon programme en plusieurs partie et lorsque je compile mon main j'obtiens ce message :
j'utilise geanymain.c:(.text.startup+0x29): undefined reference to `createLabyrinth' main.c:(.text.startup+0x31): undefined reference to `afficheLabyrinth'
Mon fichier main
labyrinthe.c contient bien labyrinthe.h et ses fonctions et labyrinthe.h est comme ceci :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 #include <stdio.h> #include <stdlib.h> #include "graphics.h" #include "labyrinthe.h" int main() { init_graphics(MAX,MAX); Case L[NBCASELONG][NBCASELARGE]; createLabyrinth(L); afficheLabyrinth(L); wait_escape(); exit(0); }
j'ai oublié quelque chose mais je vois pas et lorsque dans le main je supprime les 2 lignes create et affiche du coup j'ai bien mon graphique qui s'affiche mais rien dedans ce qui est normal
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33 #include <stdio.h> #include <stdlib.h> #define WALL 1 #define PATH 0 #define MAX 600 #define MAX 600 #define LONGUEURCASE 30 #define LARGEURCASE 30 #define NBCASELONG MAX/LONGUEURCASE #define NBCASELARGE MAX/LARGEURCASE #define RAYON (LONGUEURCASE/2.2) typedef struct Case{ POINT pos; int mh; // mur haut int mg; // mur gauche int md; // mur droit int mb; // mur bas }Case; typedef struct Direction{ int VectX; int VectY; }Direction; Direction initDirection(); Direction changeDirection(Direction dir, int deplace); void initLabyrinth(Case L[NBCASELONG][NBCASELARGE]); int connecte(Case connect[], Case c, int nbConnect); void createLabyrinth(Case L[NBCASELONG][NBCASELARGE]); void afficheCase(Case c); void afficheLabyrinth(Case L[NBCASELONG][NBCASELARGE]);
merci de votre aide
Partager