undefined identifier WINGDIAPI

i have the following error:

undefined identifier WINGDIAPI
WINGDIAPI void APIENTRY…(blah blah)

in the file ‘gl.h’. I am trying to port a project from the Mac to the PC and this is one of the few errors left. is it anything to do with the fact i am using a ‘C++ Console App’ instead of a ‘Win32 App’ for the type of project?

Yup. ;]

#include <windows.h> before gl.h

Hey… I’m getting a compile error myself. Here’s the code and compile error.

#include <iostream.h>

void main()
void CompileIssueIncrement()
cout << "Number of times people ask simple compile issues "
<< "without searching the form first is " << n++;

The error I’m getting is

--------------------Configuration: CompileIssue - Win32 Release--------------------
C:\Projects\BCompileIssue\CompileIssue.cpp(10) : error C2065: ‘n’ : undeclared identifier
Error executing cl.exe.

CompileIssue.exe - 1 error(s), 0 warning(s)

Sorry… couldn’t help myself.


after int main()
int n=0;
you have to declare a variable like “n” before you use it

in your case increment it “n++”

I really hope that you noticed he was joking.


Actually, I think that even if you declared n, there would be a run time overflow.


Yes I thought he was…
but you never know around here

A stupid question is one left unasked

Heheh, yeah. I was definitely joking. It seems that the WINGDIAPI question gets asked 3-4 times every week, and it really is just another form of the “undefined identifier” error. I would like to think that anyone who is using OpenGL has at least enough sense to figure this one out, or at the very least search the board for WINGDIAPI first.

I don’t mind helping people with compile issues (and I have many times), but when you have to answer the SAME question all the time…