ورود

View Full Version : سوال: رفع مشکل کامپایل OpenGL



helisa
پنج شنبه 11 آبان 1391, 11:40 صبح
با سلام خدمت دوستان گرامی
این برنامه:




#include




<GL/glut.h>






void




mydisplay(){





glClear(GL_COLOR_BUFFER_BIT);





glBegin(GL_POLYGON);





glVertex2f(-0.5, -0.5);





glVertex2f(-0.5, 0.5);





glVertex2f(0.5, 0.5);





glVertex2f(0.5, -0.5);





glEnd();





glFlush();





}






int




main(int argc, char** argv){






glutCreateWindow(


"simple");





glutDisplayFunc(mydisplay);





glutMainLoop();





}

به هنگام کامپایل چندین خطا می دهد مثل:
Error 1 IntelliSense:variable"WINGDIAPI" is not a type name
Error 2 IntelliSense:this declaration has no strorage class or type specifier
Error 3 IntelliSense:identifier "GLenum" is undefired
Error 4 IntelliSense:identifier "GLboolean" is undefired
Error 5 error C1083:cannot open include file:'stdafx.h':No such file or directory
از دوستان خواهشمندم هرچه سریعتر مرا راهنمایی نمایند.واقعا به مشکل برخوردم و باید پروژه بنویسم

pswin.pooya
جمعه 12 آبان 1391, 00:06 صبح
هدر فايل GL/gl.h رو include بكنيد و هدر فايل stdafx.h رو از كدتون حذف كنيد.