void renderScene(void) {
glClear(GL_COLOR_BUFFER_BIT);//clear anything that is in the buffer
glBegin(GL_TRIANGLES);
glVertex3f(-0.5,-0.5,0.0);
glVertex3f(0.5,0.0,0.0);
glVertex3f(0.0,0.5,0.0);
glEnd();
glFlush();
}
try to set the app type to “dos application”.
although it’s obviously an app with windows, the type “void main” is allowed only for dos, not for windows (for which the compiler expects a “WinMain”).
i had the same problem too. i tried to write a windows application. so it asks for Win Main(). if you try to run this as Win32 console application in Visual C++ and link opengl32.lib, glut32.lib and glu32.lib there wont be any problems.
I had linked the glu32.lib, glut32.lib, and opengl32.lib. Those cleared out a lot of errors, and left me at the point where I am at right now.
Well right now I am having the header file problem.
#include “gl/glut.h” #include “gl/gl.h”
void renderScene(void) {
glClear(GL_COLOR_BUFFER_BIT);//clear anything that is in the buffer
glBegin(GL_TRIANGLES);
glVertex3f(-0.5,-0.5,0.0);
glVertex3f(0.5,0.0,0.0);
glVertex3f(0.0,0.5,0.0);
glEnd();
glFlush();
}
: fatal error C1010: unexpected end of file while looking for precompiled header directive
Error executing cl.exe.
Can someone help me out here? I really need to get OpenGL going on my machine. I am wondering if you someone would be willing do remote login to my box to help me out. I usually use VNC remote login. If you could set up a time or let me know if you are willing to and I would give you the info. Thanks a bunch again guys.
is that a substitute for my #include?
when you use pragma comment, it tells to link these libraries, when you use #include it tells to compile using these headers.
Using pragma comment instead of visual studio linker settings. You need to add libraries to the linker, and headers to preprocessor
Take a look here
#include "gl/glut.h"
#include "gl/gl.h"
using “” means that these headers are in your local path (near the project files, .i.e .cpp .vcproj etc…)
So the preprocessor is searching in path_project/gl/header.h
using <> instead “” means that these headers are in the compiler headers path
somehow it worked. I pulled out one of my sample/testing .cpp file and added a default project, added the opengl, glut and glu .libs and it worked… I think it was the way I am selecting the features for my project. It had to be win32 instead of win32 console application If anyone has an input here please let me know…