Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#1 Le 11/01/2008, à 14:03

lomdefer

pourquoi sa compile mal ?

BOnjour il se trouve que j'ai telecharger un fichier source de jeu de carte qui se nomme jeux.c et quand je le compile voici les erreur :

luc@luc-desktop:~/Bureau$ gcc ./JEUX.C -o jeu
./JEUX.C:1:22: erreur: graphics.h : Aucun fichier ou répertoire de ce type
./JEUX.C:6:19: erreur: conio.h : Aucun fichier ou répertoire de ce type
./JEUX.C: In function «void initialisation_plan()":
./JEUX.C:43: erreur: «setfillstyle" was not declared in this scope
./JEUX.C:45: erreur: «getmaxx" was not declared in this scope
./JEUX.C:45: erreur: «getmaxy" was not declared in this scope
./JEUX.C:45: erreur: «bar3d" was not declared in this scope
./JEUX.C: In function «void init_plan()":
./JEUX.C:52: erreur: «cleardevice" was not declared in this scope
./JEUX.C:53: erreur: «setfillstyle" was not declared in this scope
./JEUX.C:54: erreur: «getmaxx" was not declared in this scope
./JEUX.C:54: erreur: «getmaxy" was not declared in this scope
./JEUX.C:54: erreur: «bar3d" was not declared in this scope
./JEUX.C: In function «void affichage(jouer, int, int)":
./JEUX.C:83: erreur: «setcolor" was not declared in this scope
./JEUX.C:84: erreur: «HORIZ_DIR" was not declared in this scope
./JEUX.C:84: erreur: «settextstyle" was not declared in this scope
./JEUX.C:85: erreur: «outtextxy" was not declared in this scope
./JEUX.C: In function «void init_joueur(jouer, int, int, int, int, int, int)":
./JEUX.C:99: erreur: «setfillstyle" was not declared in this scope
./JEUX.C:105: erreur: «bar3d" was not declared in this scope
./JEUX.C:109: erreur: «bar3d" was not declared in this scope
./JEUX.C:110: erreur: «delay" was not declared in this scope
./JEUX.C: In function «carte* melanger(carte*)":
./JEUX.C:148: erreur: «randomize" was not declared in this scope
/usr/include/stdlib.h:445: erreur: too many arguments to function «long int random()"
./JEUX.C:153: erreur: à  ce point dans le fichier
/usr/include/stdlib.h:445: erreur: too many arguments to function «long int random()"
./JEUX.C:154: erreur: à  ce point dans le fichier
./JEUX.C: In function «jouer joueur1(carte*)":
./JEUX.C:181: erreur: «setcolor" was not declared in this scope
./JEUX.C:182: erreur: «HORIZ_DIR" was not declared in this scope
./JEUX.C:182: erreur: «settextstyle" was not declared in this scope
./JEUX.C:183: erreur: «outtextxy" was not declared in this scope
./JEUX.C: In function «jouer joueur2(carte*)":
./JEUX.C:206: erreur: «setcolor" was not declared in this scope
./JEUX.C:207: erreur: «HORIZ_DIR" was not declared in this scope
./JEUX.C:207: erreur: «settextstyle" was not declared in this scope
./JEUX.C:208: erreur: «outtextxy" was not declared in this scope
./JEUX.C: In function «void afficher_joueur1(jouer)":
./JEUX.C:269: erreur: «setcolor" was not declared in this scope
./JEUX.C:270: erreur: «HORIZ_DIR" was not declared in this scope
./JEUX.C:270: erreur: «settextstyle" was not declared in this scope
./JEUX.C:271: erreur: «outtextxy" was not declared in this scope
./JEUX.C: In function «void afficher_joueur2(jouer)":
./JEUX.C:279: erreur: «setcolor" was not declared in this scope
./JEUX.C:280: erreur: «HORIZ_DIR" was not declared in this scope
./JEUX.C:280: erreur: «settextstyle" was not declared in this scope
./JEUX.C:281: erreur: «outtextxy" was not declared in this scope
./JEUX.C: In function «void afficher_attente(jouer)":
./JEUX.C:289: erreur: «setcolor" was not declared in this scope
./JEUX.C:290: erreur: «HORIZ_DIR" was not declared in this scope
./JEUX.C:290: erreur: «settextstyle" was not declared in this scope
./JEUX.C:291: erreur: «outtextxy" was not declared in this scope
./JEUX.C: In function «void resultat(jouer, jouer)":
./JEUX.C:345: erreur: «cleardevice" was not declared in this scope
./JEUX.C:346: erreur: «BLINK" was not declared in this scope
./JEUX.C:346: erreur: «setcolor" was not declared in this scope
./JEUX.C:347: erreur: «HORIZ_DIR" was not declared in this scope
./JEUX.C:347: erreur: «settextstyle" was not declared in this scope
./JEUX.C:349: erreur: «outtextxy" was not declared in this scope
./JEUX.C:351: erreur: «outtextxy" was not declared in this scope
./JEUX.C:353: erreur: «outtextxy" was not declared in this scope
./JEUX.C: At global scope:
./JEUX.C:358: erreur: «::main" must return «int"
./JEUX.C: In function «int main()":
./JEUX.C:363: erreur: «DETECT" was not declared in this scope
./JEUX.C:364: erreur: «initgraph" was not declared in this scope
./JEUX.C:365: erreur: «graphresult" was not declared in this scope
./JEUX.C:366: erreur: «grOk" was not declared in this scope
./JEUX.C:368: erreur: «grapherrormsg" was not declared in this scope
./JEUX.C:370: erreur: «getch" was not declared in this scope
./JEUX.C:373: erreur: «delay" was not declared in this scope
./JEUX.C:400: erreur: «getch" was not declared in this scope
./JEUX.C:401: erreur: «closegraph" was not declared in this scope

Je veux pas corriger les erreurs, mais vu que je l'ai telecharger il devrait pas y avoir d'erreur non ??
Il me manque des bibliothèques a installer non ??

Hors ligne

#2 Le 11/01/2008, à 14:15

Coolgeek

Re : pourquoi sa compile mal ?

je ne sais pas pour graphics.h mais conio.h est une bibliotheque fourni sous windows pour de l'execution DOS (fonction setfillstyle, getmaxx, getmaxy,...) et pas sous linux.

Le source que tu as est bien fait pour linux ? ca a pas l'air en tout cas.

Hors ligne

#3 Le 11/01/2008, à 18:28

LittleWhite

Re : pourquoi sa compile mal ?

Pour compiler il faut juste qu'il trouve les .h qui dit aux premières ligne
En pensant que tu est sous Linux ( enfin m'etonnerais mais bon a cause de conio.h ) fait un find /usr/include -name "conio.h" afin  de trouver le fichier.
après tu donne le chemin aux programmes ( avec l'include )
Sous windows pareil avec l'outil de recherche ou tu lui donne le fichier.
( tu peux mettre le fichier dans le repertoire ou tu compil et tu met #include "conio.h" ( en suprimant la ligne de base )
Tu fais pareil pour graphics.h


Linux ou mourir
Pour avoir des problemes : demarrer Windows
Script de compression multi archive : http://forum.ubuntu-fr.org/viewtopic.php?id=225297

Hors ligne

#4 Le 11/01/2008, à 20:00

lomdefer

Re : pourquoi sa compile mal ?

Non a vrai dire je ne sais pas du tout si ce programme est fait pour linux, mais oui je suis bien sous linux.

Hors ligne