Pb de compilation

cs_norton Messages postés 215 Date d'inscription mardi 21 janvier 2003 Statut Membre Dernière intervention 21 août 2011 - 22 janv. 2004 à 11:40
ghost260984 Messages postés 20 Date d'inscription mercredi 18 juin 2003 Statut Membre Dernière intervention 14 décembre 2004 - 26 mai 2004 à 14:17
bonjour, je desir compiler le code suivant mais j'ai une erreur.
mon code :

#include <windows.h>
#include <gl.h>
#include <glut.h>

void Display();
void Reshape(int,int);

int main( int argc, char *argv[ ])
{
glutInit(&argc,argv);
glutInitDisplayMode(GLUT_RGBA | GLUT_SINGLE);

glutInitWindowSize(640, 480);
glutInitWindowPosition(50,50);
glutCreateWindow("OpenGl");

glutDisplayFunc(Display);
glutReshapeFunc(Reshape);

glutMainLoop();
return 0;
}

void Display()
{
glClearColor(0,0,0,0);
glClear(GL_COLOR_BUFFER_BIT);

glBegin(GL_TRIANGLES);
glVertex2i(0,1);
glVertex2i(-1,0);
glVertex2i(1,0);
glEnd();

glBegin(GL_QUADS);
glVertex2d(2,-1);
glVertex2d(4,-1);
glVertex2d(4,1);
glVertex2d(2,1);
glEnd();

glFlush();
}

void Reshape(int w,int h)
{
float L;
float H;

if (w<=h)
{
H=(GLfloat) (10*h/w);
L=10.0;
}
else
{
H=10.0;
L=(GLfloat) (10*w/h);
}
gluOrtho2D(-L/2,L/2,-H/2,H/2);
}

mon compilateur me donne l'erreur suivant a la compilation:

fatal error C1010: unexpected end of file while looking for precompiled header directive.

je sait pas comment faire pour que ca vienne plus.
merci.
@+ Norton

6 réponses

hilairenicolas Messages postés 398 Date d'inscription jeudi 30 octobre 2003 Statut Membre Dernière intervention 15 juin 2007 2
22 janv. 2004 à 11:50
J'ai deja eu ca, ca venait de ce sacré "StdAfx.cpp", s'il a été généré, il faut l'inclure au tout début
#include "StdAfx.h"
0
cs_norton Messages postés 215 Date d'inscription mardi 21 janvier 2003 Statut Membre Dernière intervention 21 août 2011
22 janv. 2004 à 11:57
ok je vais essayer ça.
Merci de ton aide.
@+ Norton
0
cs_norton Messages postés 215 Date d'inscription mardi 21 janvier 2003 Statut Membre Dernière intervention 21 août 2011
22 janv. 2004 à 13:15
Quel sont c'est erreurs (c'est du a quoi ?)
comment s'en débarasser ?

test3d.obj : error LNK2001: unresolved external symbol _glutMainLoop@0
test3d.obj : error LNK2001: unresolved external symbol _glutDisplayFunc@4
test3d.obj : error LNK2001: unresolved external symbol _glutCreateWindow@4
test3d.obj : error LNK2001: unresolved external symbol _glutInitWindowPosition@8
test3d.obj : error LNK2001: unresolved external symbol _glutInitWindowSize@8
test3d.obj : error LNK2001: unresolved external symbol _glutInitDisplayMode@4
test3d.obj : error LNK2001: unresolved external symbol _glutInit@8
test3d.obj : error LNK2001: unresolved external symbol __imp__glFlush@0
test3d.obj : error LNK2001: unresolved external symbol __imp__glClear@4
test3d.obj : error LNK2001: unresolved external symbol __imp__glClearColor@16
Debug/test3d.exe : fatal error LNK1120: 10 unresolved externals
Error executing link.exe.

test3d.exe - 11 error(s), 0 warning(s)
0
magic_Nono Messages postés 1878 Date d'inscription jeudi 16 octobre 2003 Statut Membre Dernière intervention 16 mars 2011
22 janv. 2004 à 13:41
As tu inclu toutes les bibliothèques lors du linkage (2e étape de compilation)

Voire: les as tu incluses dans le projet Visual?

Magic Nono: l'informagicien!
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
cs_norton Messages postés 215 Date d'inscription mardi 21 janvier 2003 Statut Membre Dernière intervention 21 août 2011
22 janv. 2004 à 13:49
ha non c'est bon j'avais oublié d'inclure les bibliothèques.
merci de ton aide.
@+ norton
0
ghost260984 Messages postés 20 Date d'inscription mercredi 18 juin 2003 Statut Membre Dernière intervention 14 décembre 2004
26 mai 2004 à 14:17
Ca sert a rien de s' embeter avec le bib , il suffit juste d enlever les headers precompile dans les options du projet :

Project/Settings->onglet C/C++->Precompiled Headers.
on desactive ca et ca marche voila voila
bye
0
Rejoignez-nous