OpenGL ES Tutorial - "Winmain": function cannot be overloaded

I am trying to learn OpenGL ES using the "OpenGL ES Training Course" (OpenGL ES tutorial). I am using OPENGL-ES 1.1 WINDOWS PC EMULATION with visual studio 2010. I am trying to compile the "hello triangle" program and get an error message:

'WinMain': function cannot be overloaded

EDIT: I have only one WinMain definition in the project: one in the "hello triangle" source code (which I did not write).

Can someone tell me what is going on?

+4
source share
3 answers

It looks like you have two WinMain definitions, or perhaps a prototype and definition, that disagree.

+1
source

I also had a problem. It showed that I overloaded the function: My old text:

 #include "windows.h" int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, long lpCmdLine, int nCmdShow) { } 

and my new text:

 int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) 

It works with new text

0
source

Try

 int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow){ // Your Code. } 

Instead

 int WinMain(){ // Your Code. } 
0
source

All Articles