OSG sample code runs, gl.h error

OSG run the sample code that comes osgrobot when there are mistakes:
1>  osgrobot.cpp
1> c: \ program files (x86) \ windows kits \ 8.1 \ include \ um \ gl \ gl.h (1157): error C2144: syntax error: in front of "void" should have ";"
1> c: \ program files (x86) \ windows kits \ 8.1 \ include \ um \ gl \ gl.h (1157): error C4430: missing type specifier - assumed to int. Note: C ++ does not support default int
1> c: \ program files (x86) \ windows kits \ 8.1 \ include \ um \ gl \ gl.h (1158): error C2144: syntax error: in front of "void" should have ";"
1> c: \ program files (x86) \ windows kits \ 8.1 \ include \ um \ gl \ gl.h (1158): error C4430: missing type specifier - assumed to int. Note: C ++ does not support default int
1>c:\program files (x86)\windows kits\8.1\include\um\gl\gl.h(1158): error C2086: “int WINGDIAPI”: 重定义
1> c: \ program files (x86) \ windows kits \ 8.1 \ include \ um \ gl \ gl.h (1157): note: See "WINGDIAPI" statement
1> c: \ program files (x86) \ windows kits \ 8.1 \ include \ um \ gl \ gl.h (1159): error C4430: missing type specifier - assumed to int. Note: C ++ does not support default int
1>c:\program files (x86)\windows kits\8.1\include\um\gl\gl.h(1159): error C2086: “int WINGDIAPI”: 重定义
1> c: \ program files (x86) \ windows kits \ 8.1 \ include \ um \ gl \ gl.h (1157): note: See "WINGDIAPI" statement
......


Solution:
Before all the header files, add the following code:
#include <Windows.h>
As follows:



Guess you like

Origin www.cnblogs.com/zcmacbeth/p/11228533.html