Tracer des lines

lunatic34 Messages postés 36 Date d'inscription lundi 13 novembre 2000 Statut Membre Dernière intervention 27 mai 2006 - 31 oct. 2005 à 23:11
lunatic34 Messages postés 36 Date d'inscription lundi 13 novembre 2000 Statut Membre Dernière intervention 27 mai 2006 - 2 nov. 2005 à 14:35
Voila je commence en visual c++ et je voudrais tracer des lines mais sa marche pas donc est ce que vous pouvez m'aider?
voila mon code:
#include "graphics.h"
#include <conio.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#define PI 3.14116

void Initialize(void);

void main()
{
int MaxX,MaxY;

Initialize();//initialisation du mode graphique

MaxX = 100;
MaxY = 180;

//tracer de deux axes
moveto(MaxX/2,0);
lineto(MaxX/2,MaxY);

moveto(0,MaxY/2);
lineto(MaxX,MaxY/2);

//se positionner en 0,MaxY/2
moveto(0,MaxY/2);

getch();

closegraph(); //arrêt du mode graphique
}


void Initialize(void)
{
int GraphDriver; /* The Graphics device driver */
int GraphMode; /* The Graphics mode value */
int ErrorCode; /* Reports any graphics errors */


GraphDriver = DETECT; /* Request auto-detection */
initgraph( &GraphDriver, &GraphMode, "" );
ErrorCode = graphresult(); /* Read result of initialization*/
if( ErrorCode != grOk )
{ /* Error occured during init */
printf(" Graphics System Error: %s\n", grapherrormsg( ErrorCode ) );
exit( 1 );
}

}

MAIS SA NE MARCHE PAS!!!!!!

3 réponses

La Guite Messages postés 45 Date d'inscription vendredi 24 septembre 2004 Statut Membre Dernière intervention 27 novembre 2009
1 nov. 2005 à 00:11
Salut,
çà marche pas à la compilation, ou sa te donne rien ???
0
vecchio56 Messages postés 6535 Date d'inscription lundi 16 décembre 2002 Statut Membre Dernière intervention 22 août 2010 14
1 nov. 2005 à 10:00
Ca compile surement pas sous VC++, ce genre de code est signé Borland, donc il te faut un vieux Borland C ou Turbo C
0
lunatic34 Messages postés 36 Date d'inscription lundi 13 novembre 2000 Statut Membre Dernière intervention 27 mai 2006
2 nov. 2005 à 14:35
en faite, quand je compile il m'affiche 14 erreurs du genre :

useFonctions_bgi.obj : error LNK2001: unresolved external symbol _closegraph
useFonctions_bgi.obj : error LNK2001: unresolved external symbol _ellipse
useFonctions_bgi.obj : error LNK2001: unresolved external symbol _rectangle
useFonctions_bgi.obj : error LNK2001: unresolved external symbol _circle
useFonctions_bgi.obj : error LNK2001: unresolved external symbol _getmaxcolor
useFonctions_bgi.obj : error LNK2001: unresolved external symbol _lineto
useFonctions_bgi.obj : error LNK2001: unresolved external symbol _moveto
useFonctions_bgi.obj : error LNK2001: unresolved external symbol _setcolor
useFonctions_bgi.obj : error LNK2001: unresolved external symbol _getmaxy
useFonctions_bgi.obj : error LNK2001: unresolved external symbol _getmaxx
useFonctions_bgi.obj : error LNK2001: unresolved external symbol _grapherrormsg
useFonctions_bgi.obj : error LNK2001: unresolved external symbol _graphresult
useFonctions_bgi.obj : error LNK2001: unresolved external symbol _initgraph
Debug/projet1.exe : fatal error LNK1120: 13 unresolved externals
Error executing link.exe.


projet1.exe - 14 error(s), 0 warning(s)

j'ai en plus inclus le fichier graphics.h
0
Rejoignez-nous