when writing windows programs you need to define a winmain procedure instead of the main procedure like usual.
the concret params and so on you can read in the MSDE (language documentation) about it.
C++ is not a basic language, so learn it as much well as you can.
OpenGL must be learnt, so learn it before trying making anything with it.
OpenGL is wrote with C, not C++.
Now, if you want to make a circle, i need to know some:
are you using glut ? wgl ? windows with opengl ?
if it’s glut, you must link your program with glut32.lib, glu32.lib and opengl32.lib
otherwise, it won’t work
//I will have some advises:
//1. C++ is not a basic language, so learn it as much well as you can.
Ok, I’m about to learn it.
OpenGL must be learnt, so learn it before trying making anything with it.
I’m trying to make my college exercises and the first question was: compile and link the file circle.c
The file is OK, I just must compile it.
//3. OpenGL is wrote with C, not C++.
//Now, if you want to make a circle, i need to know some:
//are you using glut ? wgl ? windows with opengl ?
//if it’s glut, you must link your program with glut32.lib, glu32.lib and opengl32.lib
otherwise, it won’t work
The circle-file exists and I linked with glut, so no problems with it.
I know it was mentioned before, but are you ABSOLUTELY sure you declared a WinMain function instead of the non-Windows main function? In other words, instead of having something like this:
int main()
{
// stuff
return 0;
}
Declare this:
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int iCmdShow)
{
// stuff
return 0;
}
I’d agree with sebnuoc. Is the project type a Win32 console application or a Win32 application? In the case of the former a winmain(…) function isnt used, but int main(…) is.
I am still learning OpenGL and use console applications for all my OpenGL programs. They are far simpler and I would recommend this approach if you are new to C++ as well.