why can't i compile opneGL???

hi

i have installed the VC++ but i don’t get where the openGL fits in … where do i put the directory or folders cos when i try to write a code and compile it it says:

Cannot compile the C:\Program files\Visual Studio… no compile tool is associtated with the file extension

i am just praticing my first openGL coding:
/simple.c/
#include <GL/glut.h>

void display() {
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){
glutInit(&argc, argv);
glutCreateWindow(“simple”);
glutDisplayFunc(display);
glutMainLoop();
}

That error happens when you try to compile a file that isn’t .C or .CPP

Have you created a project( and workspace)?

If so, just add your file (that should have a .C extension) to the project’s source files making sure there are no other files included.

Then click “Build” and hopefully it’ll make something!

What have you named the file you are trying to compile?

Did you use .C or .CPP as the extension of the file?

Originally posted by catalanoli:
[b]hi

i have installed the VC++ but i don’t get where the openGL fits in … where do i put the directory or folders cos when i try to write a code and compile it it says:

Cannot compile the C:\Program files\Visual Studio… no compile tool is associtated with the file extension

i am just praticing my first openGL coding:
/simple.c/
#include <GL/glut.h>

void display() {
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){
glutInit(&argc, argv);
glutCreateWindow(“simple”);
glutDisplayFunc(display);
glutMainLoop();
}

[/b]

ya what those guys said, but to answer your actual question, stick opengl32.lib, glu32.lib, glaux.lib, and glut32.lib in the lib directory in the visual studio folder