extern class object not working :S - c++

moving a global class object into its corresponding cpp file so i can declare it as an extern in order to use it in multiple files to avoid re-declaration compile errors.
Models.h
#ifndef MODELS_H
#define MODELS_H
#include <xnamath.h>
class Models {
public:
ID3D11Buffer* meshVertBuff;
ID3D11Buffer* meshIndexBuff;
std::vector<int> meshSubsetIndexStart;
std::vector<int> meshSubsetTexture;
int meshSubsets;
XMMATRIX Player;
};
#endif
Models.cpp
#include "Models.h"
Models Model_1;
Models Model_2;
Main.cpp
#include "Input.h"
#include "Models.h"
#include "Player.h"
#include "Camera.h"
extern Camera MainCamera;
extern My_Player mainPlayer;
extern Models Model_1;
extern Models Model_2;
oddly it's not working and i can't see why as i just get a ton of XNAMATH errors when i moved the class objects to model.cpp, if they're in model.h it's fine but then i cant use it in other modules. :S any help is appreciated.
errors -
Error 173 error C1003: error count exceeds 100; stopping compilation C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 429
Error 103 error C2040: '_XMMATRIX::operator ()' : 'int &(UINT,UINT)' differs in levels of indirection from 'int (UINT,UINT)' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 361
Error 28 error C2059: syntax error : ')' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 159
Error 37 error C2059: syntax error : ')' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 160
Error 57 error C2059: syntax error : ')' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 324
Error 110 error C2059: syntax error : ')' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 363
Error 114 error C2059: syntax error : ')' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 366
Error 118 error C2059: syntax error : ')' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 367
Error 119 error C2059: syntax error : '}' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 372
Error 121 error C2059: syntax error : '}' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 372
Error 104 error C2059: syntax error : 'return' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 361
Error 89 error C2061: syntax error : identifier 'CONST' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 358
Error 137 error C2061: syntax error : identifier 'CONST' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 398
Error 139 error C2061: syntax error : identifier 'CONST' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 400
Error 147 error C2061: syntax error : identifier 'CONST' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 412
Error 149 error C2061: syntax error : identifier 'CONST' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 414
Error 162 error C2061: syntax error : identifier 'CONST' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 430
Error 166 error C2061: syntax error : identifier 'CONST' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 432
Error 168 error C2061: syntax error : identifier 'CONST' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 434
Error 49 error C2061: syntax error : identifier 'FLOAT' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 316
Error 51 error C2061: syntax error : identifier 'FLOAT' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 317
Error 53 error C2061: syntax error : identifier 'FLOAT' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 323
Error 58 error C2061: syntax error : identifier 'FLOAT' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 325
Error 87 error C2061: syntax error : identifier 'FLOAT' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 354
Error 135 error C2061: syntax error : identifier 'FLOAT' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 397
Error 145 error C2061: syntax error : identifier 'FLOAT' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 411
Error 164 error C2061: syntax error : identifier 'FLOAT' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 431
Error 160 error C2061: syntax error : identifier 'HALF' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 429
Error 141 error C2065: '_x' : undeclared identifier C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 397
Error 151 error C2065: '_x' : undeclared identifier C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 411
Error 170 error C2065: '_x' : undeclared identifier C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 429
Error 142 error C2065: '_y' : undeclared identifier C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 397
Error 152 error C2065: '_y' : undeclared identifier C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 411
Error 171 error C2065: '_y' : undeclared identifier C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 429
Error 107 error C2065: 'CONST' : undeclared identifier C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 363
Error 111 error C2065: 'CONST' : undeclared identifier C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 366
Error 115 error C2065: 'CONST' : undeclared identifier C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 367
Error 153 error C2065: 'pArray' : undeclared identifier C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 412
Error 34 error C2086: 'int FLOAT' : redefinition C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 160
Error 97 error C2143: syntax error : missing ';' before '&' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 361
Error 106 error C2143: syntax error : missing ';' before '&' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 363
Error 123 error C2143: syntax error : missing ';' before '&' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 378
Error 91 error C2143: syntax error : missing ';' before '(' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 360
Error 29 error C2143: syntax error : missing ';' before '{' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 159
Error 38 error C2143: syntax error : missing ';' before '{' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 160
Error 120 error C2143: syntax error : missing ';' before '}' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 372
Error 108 error C2146: syntax error : missing ')' before identifier '_XMMATRIX' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 363
Error 112 error C2146: syntax error : missing ')' before identifier '_XMMATRIX' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 366
Error 116 error C2146: syntax error : missing ')' before identifier '_XMMATRIX' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 367
Error 26 error C2146: syntax error : missing ')' before identifier 'fDegrees' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 159
Error 35 error C2146: syntax error : missing ')' before identifier 'fRadians' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 160
Error 54 error C2146: syntax error : missing ')' before identifier 'S' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 324
Error 40 error C2146: syntax error : missing ';' before identifier '__vector4i' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 217
Error 60 error C2146: syntax error : missing ';' before identifier '_11' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 342
Error 66 error C2146: syntax error : missing ';' before identifier '_21' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 343
Error 72 error C2146: syntax error : missing ';' before identifier '_31' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 344
Error 78 error C2146: syntax error : missing ';' before identifier '_41' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 345
Error 126 error C2146: syntax error : missing ';' before identifier 'HALF' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 386
Error 43 error C2146: syntax error : missing ';' before identifier 'i' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 246
Error 84 error C2146: syntax error : missing ';' before identifier 'm' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 347
Error 46 error C2146: syntax error : missing ';' before identifier 'u' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 260
Error 129 error C2146: syntax error : missing ';' before identifier 'x' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 391
Error 154 error C2146: syntax error : missing ';' before identifier 'x' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 423
Error 31 error C2146: syntax error : missing ';' before identifier 'XMConvertToDegrees' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 160
Error 23 error C2146: syntax error : missing ';' before identifier 'XMConvertToRadians' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 159
Error 132 error C2146: syntax error : missing ';' before identifier 'y' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 392
Error 157 error C2146: syntax error : missing ';' before identifier 'y' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 424
Error 105 error C2238: unexpected token(s) preceding ';' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 361
Error 55 error C2365: 'operator *' : redefinition; previous definition was 'function' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 324
Error 117 error C2365: 'operator *' : redefinition; previous definition was 'function' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 367
Error 113 error C2365: 'operator *=' : redefinition; previous definition was 'function' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 366
Error 24 error C2433: 'FLOAT' : '__forceinline' not permitted on data declarations C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 159
Error 32 error C2433: 'FLOAT' : '__forceinline' not permitted on data declarations C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 160
Error 56 error C2440: 'initializing' : cannot convert from 'int' to 'XMVECTOR' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 324
Error 30 error C2447: '{' : missing function header (old-style formal list?) C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 159
Error 39 error C2447: '{' : missing function header (old-style formal list?) C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 160
Error 125 error C2530: 'CXMMATRIX' : references must be initialized C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 378
Error 136 error C2535: '_XMFLOAT2::_XMFLOAT2(void)' : member function already defined or declared C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 397
Error 138 error C2535: '_XMFLOAT2::_XMFLOAT2(void)' : member function already defined or declared C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 398
Error 161 error C2535: '_XMHALF2::_XMHALF2(void)' : member function already defined or declared C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 429
Error 163 error C2535: '_XMHALF2::_XMHALF2(void)' : member function already defined or declared C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 430
Error 165 error C2535: '_XMHALF2::_XMHALF2(void)' : member function already defined or declared C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 431
Error 167 error C2535: '_XMHALF2::_XMHALF2(void)' : member function already defined or declared C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 432
Error 88 error C2535: '_XMMATRIX::_XMMATRIX(void)' : member function already defined or declared C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 354
Error 90 error C2535: '_XMMATRIX::_XMMATRIX(void)' : member function already defined or declared C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 358
Error 146 error C2535: 'XMFLOAT2A::XMFLOAT2A(void)' : member function already defined or declared C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 411
Error 148 error C2535: 'XMFLOAT2A::XMFLOAT2A(void)' : member function already defined or declared C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 412
Error 102 error C2556: 'int &_XMMATRIX::operator ()(UINT,UINT)' : overloaded function differs only by return type from 'int _XMMATRIX::operator ()(UINT,UINT)' C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 361
Error 144 error C2614: '_XMFLOAT2' : illegal member initialization: 'x' is not a base or member C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 397
Error 143 error C2614: '_XMFLOAT2' : illegal member initialization: 'y' is not a base or member C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 397
Error 172 error C2614: '_XMHALF2' : illegal member initialization: 'y' is not a base or member C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 429
Error 95 error C2719: 'Column': formal parameter with __declspec(align('16')) won't be aligned C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 360
Error 100 error C2719: 'Column': formal parameter with __declspec(align('16')) won't be aligned C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 361
Error 94 error C2719: 'Row': formal parameter with __declspec(align('16')) won't be aligned C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 360
Error 99 error C2719: 'Row': formal parameter with __declspec(align('16')) won't be aligned C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 361
Error 50 error C2805: binary 'operator *=' has too few parameters C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 316
Error 59 error C2805: binary 'operator /' has too few parameters C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 325
Error 52 error C2805: binary 'operator /=' has too few parameters C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 317
Error 140 error C2805: binary 'operator =' has too few parameters C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 400
Error 150 error C2805: binary 'operator =' has too few parameters C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 414
Error 169 error C2805: binary 'operator =' has too few parameters C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 434
Error 93 error C3646: 'CONST' : unknown override specifier C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 360
Error 25 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 159
Error 27 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 159
Error 33 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 160
Error 36 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 160
Error 41 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 217
Error 42 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 217
Error 44 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 246
Error 45 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 246
Error 47 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 260
Error 48 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 260
Error 61 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 342
Error 62 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 342
Error 63 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 342
Error 64 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 342
Error 65 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 342
Error 67 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 343
Error 68 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 343
Error 69 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 343
Error 70 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 343
Error 71 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 343
Error 73 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 344
Error 74 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 344
Error 75 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 344
Error 76 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 344
Error 77 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 344
Error 79 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 345
Error 80 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 345
Error 81 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 345
Error 82 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 345
Error 83 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 345
Error 85 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 347
Error 86 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 347
Error 92 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 360
Error 96 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 360
Error 98 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 361
Error 101 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 361
Error 109 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 363
Error 122 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 378
Error 124 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 378
Error 127 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 386
Error 128 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 386
Error 130 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 391
Error 131 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 391
Error 133 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 392
Error 134 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 392
Error 155 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 423
Error 156 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 423
Error 158 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 424
Error 159 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\xnamath.h 424
178 IntelliSense: expected a ')' d:\d3d11normalmap\d3d11normalmap\randomvariables.h 40
179 IntelliSense: expected a declaration d:\d3d11normalmap\d3d11normalmap\randomvariables.h 40
177 IntelliSense: expected an identifier d:\d3d11normalmap\d3d11normalmap\randomvariables.h 40
176 IntelliSense: no suitable constructor exists to convert from "XMVECTOR (FLOAT x, FLOAT y, FLOAT z, FLOAT w)" to "__m128" d:\d3d11normalmap\d3d11normalmap\randomvariables.h 40
174 IntelliSense: the #endif for this directive is missing d:\d3d11normalmap\d3d11normalmap\randomvariables.h 3
175 IntelliSense: this declaration has no storage class or type specifier d:\d3d11normalmap\d3d11normalmap\randomvariables.h 34

Related

Errors when compiling code from Practical Programming 2nd with Custom header

I'm starting with the first example from PPP2nd and immediately I have encountered significant issue with the custom header. I have put the header in the compiler include directory for ease of access. Both VS 2010 and 2012 will not compile. Your help would be greatly appreciated.
#include <std_lib_facilities.h>
int main()
{
cout << "Hello,world\n";
return 0;
}
Error 1 error C2868: 'std::vector<_Ty,_Alloc>::size_type' : illegal syntax for using-declaration; expected qualified-name c:\program files (x86)\microsoft visual studio 11.0\vc\include\std_lib_facilities.h 71 1 HelloWorld
Error 2 error C2143: syntax error : missing ';' before '=' c:\program files (x86)\microsoft visual studio 11.0\vc\include\std_lib_facilities.h 71 1 HelloWorld
Error 3 error C2238: unexpected token(s) preceding ';' c:\program files (x86)\microsoft visual studio 11.0\vc\include\std_lib_facilities.h 71 1 HelloWorld
Error 4 error C2061: syntax error : identifier 'initializer_list' c:\program files (x86)\microsoft visual studio 11.0\vc\include\std_lib_facilities.h 80 1 HelloWorld
Error 5 error C2535: 'Vector<T>::Vector(void)' : member function already defined or declared c:\program files (x86)\microsoft visual studio 11.0\vc\include\std_lib_facilities.h 80 1 HelloWorld
Error 6 error C2868: 'std::basic_string<_Elem,_Traits,_Alloc>::size_type' : illegal syntax for using-declaration; expected qualified-name c:\program files (x86)\microsoft visual studio 11.0\vc\include\std_lib_facilities.h 102 1 HelloWorld
Error 7 error C2143: syntax error : missing ';' before '=' c:\program files (x86)\microsoft visual studio 11.0\vc\include\std_lib_facilities.h 102 1 HelloWorld
Error 8 error C2238: unexpected token(s) preceding ';' c:\program files (x86)\microsoft visual studio 11.0\vc\include\std_lib_facilities.h 102 1 HelloWorld
Error 9 error C2143: syntax error : missing ';' before '{' c:\program files (x86)\microsoft visual studio 11.0\vc\include\std_lib_facilities.h 213 1 HelloWorld
Error 10 error C2275: 'std::uniform_int_distribution<>' : illegal use of this type as an expression c:\program files (x86)\microsoft visual studio 11.0\vc\include\std_lib_facilities.h 213 1 HelloWorld
Error 11 error C2143: syntax error : missing ';' before '}' c:\program files (x86)\microsoft visual studio 11.0\vc\include\std_lib_facilities.h 213 1 HelloWorld
Error 12 error C2988: unrecognizable template declaration/definition c:\program files (x86)\microsoft visual studio 11.0\vc\include\std_lib_facilities.h 222 1 HelloWorld
Error 13 error C2059: syntax error : 'using' c:\program files (x86)\microsoft visual studio 11.0\vc\include\std_lib_facilities.h 222 1 HelloWorld
Error 14 error C2143: syntax error : missing ';' before '<' c:\program files (x86)\microsoft visual studio 11.0\vc\include\std_lib_facilities.h 243 1 HelloWorld
Error 15 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\program files (x86)\microsoft visual studio 11.0\vc\include\std_lib_facilities.h 243 1 HelloWorld
Error 16 error C2988: unrecognizable template declaration/definition c:\program files (x86)\microsoft visual studio 11.0\vc\include\std_lib_facilities.h 243 1 HelloWorld
Error 17 error C2059: syntax error : '<' c:\program files (x86)\microsoft visual studio 11.0\vc\include\std_lib_facilities.h 243 1 HelloWorld
Error 18 error C2143: syntax error : missing ';' before '{' c:\program files (x86)\microsoft visual studio 11.0\vc\include\std_lib_facilities.h 251 1 HelloWorld
Error 19 error C2447: '{' : missing function header (old-style formal list?) c:\program files (x86)\microsoft visual studio 11.0\vc\include\std_lib_facilities.h 251 1 HelloWorld
20 IntelliSense: type name is not allowed c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\std_lib_facilities.h 213 81 HelloWorld
21 IntelliSense: expected a ';' c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\std_lib_facilities.h 213 107 HelloWorld
Upgrading to visual studio 2015 allowed me to compile the source file with the customer header file "std_lib_facilities.h" provided by the author.
Thanks all for the guidance and feedback.

Class Template in Header file giving me lots of errors

This following code:
main.cpp:
#include <iostream>
#include <list>
#include <map>
#include <string>
#include "core_table.h"
using std::cout;
using std::endl;
int main() {
core_table<int, int> t;
cout << sizeof(t) << endl;
return 0;
}
core_table.h:
#ifndef CORE_TABLE_H
#define CORE_TABLE_H
template <typename key, typename value>
class core_table {
std::list<key, value> l;
std::map<key, value> m;
public:
};
#endif // !CORE_TABLE_H
is giving me this list of errors in Visual Studio 2017. I don't know how to solve it, since this is my first time trying to structure my code in multiple files.
Severity Code Description Project File Line Suppression State
Error C2516 '_Alloc': is not a legal base class ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 984
Error C2825 '_Alloc': must be a class or namespace when followed by '::' ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 659
Error C2510 '_Alloc': left of '::' must be a class/struct/union ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 659
Error C3646 'value_type': unknown override specifier ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 659
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 659
Error C2825 '_Ty': must be a class or namespace when followed by '::' ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 323
Error C2510 '_Ty': left of '::' must be a class/struct/union ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 323
Error C2143 syntax error: missing ';' before '*' ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 323
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 323
Error C2238 unexpected token(s) preceding ';' ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 323
Error C2039 'type': is not a member of 'std::_Get_pointer_type<_Alloc,void>' ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 661
Error C3646 'pointer': unknown override specifier ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 662
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 662
Error C2039 'type': is not a member of 'std::_Get_pointer_type<_Alloc,void>' ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 337
Error C3646 '_Ptrty': unknown override specifier ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 337
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 337
Error C2825 '_Ty': must be a class or namespace when followed by '::' ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 338
Error C2510 '_Ty': left of '::' must be a class/struct/union ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 338
Error C3646 '_Valty': unknown override specifier ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 338
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 338
Error C2065 '_Ptrty': undeclared identifier ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 339
Error C2923 'std::pointer_traits': '_Ptrty' is not a valid template type argument for parameter '_Ty' ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 339
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 339
Error C2146 syntax error: missing '>' before identifier '_Valty' ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 339
Error C2903 'rebind': symbol is neither a class template nor a function template ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 339
Error C2371 'std::_Get_const_pointer_type<_Alloc,void>::type': redefinition; different basic types ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 339
Error C2039 'type': is not a member of 'std::_Get_pointer_type<_Alloc,void>' ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 353
Error C3646 '_Ptrty': unknown override specifier ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 353
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 353
Error C2065 '_Ptrty': undeclared identifier ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 354
Error C2923 'std::pointer_traits': '_Ptrty' is not a valid template type argument for parameter '_Ty' ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 354
Error C2903 'rebind': symbol is neither a class template nor a function template ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 354
Error C2371 'std::_Get_void_pointer_type<_Alloc,void>::type': redefinition; different basic types ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 354
Error C2039 'type': is not a member of 'std::_Get_pointer_type<_Alloc,void>' ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 368
Error C3646 '_Ptrty': unknown override specifier ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 368
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 368
Error C2065 '_Ptrty': undeclared identifier ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 369
Error C2923 'std::pointer_traits': '_Ptrty' is not a valid template type argument for parameter '_Ty' ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 369
Error C2903 'rebind': symbol is neither a class template nor a function template ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 369
Error C2371 'std::_Get_const_void_pointer_type<_Alloc,void>::type': redefinition; different basic types ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 369
Error C2039 'type': is not a member of 'std::_Get_pointer_type<_Alloc,void>' ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 383
Error C3646 '_Ptrty': unknown override specifier ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 383
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 383
Error C2065 '_Ptrty': undeclared identifier ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 384
Error C2923 'std::pointer_traits': '_Ptrty' is not a valid template type argument for parameter '_Ty' ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 384
Error C2955 'std::pointer_traits': use of class template requires template argument list ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 384
Error C2371 'std::_Get_difference_type<_Ty,void>::type': redefinition; different basic types ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 384
Error C3646 'allocate': unknown override specifier ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 688
Error C2065 '_Al': undeclared identifier ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 688
Error C2275 '_Alloc': illegal use of this type as an expression ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 688
Error C2226 syntax error: unexpected type 'std::allocator_traits<_Alloc>::size_type' ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 688
Error C2334 unexpected token(s) preceding '{'; skipping apparent function body ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 689
Error C3646 'allocate': unknown override specifier ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 693
Error C2065 '_Al': undeclared identifier ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 693
Error C2275 '_Alloc': illegal use of this type as an expression ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 693
Error C2226 syntax error: unexpected type 'std::allocator_traits<_Alloc>::size_type' ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 693
Error C2334 unexpected token(s) preceding '{'; skipping apparent function body ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 695
Error C2061 syntax error: identifier 'pointer' ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 700
Error C2039 'pointer': is not a member of 'std::allocator_traits<_Alloc>' ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 990
Error C3646 'pointer': unknown override specifier ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 990
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 990
Error C2027 use of undefined type 'std::_Replace_first_parameter<_Other,_Ty>' ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 469
Error C3646 'type': unknown override specifier ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 469
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 469
Error C2027 use of undefined type 'std::_Replace_first_parameter<_Other,_Ty>' ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\xmemory0 469
Error C2535 'std::list<key,value>::list(unsigned int,const int &)': member function already defined or declared ali c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.24728\include\list 923
What am I doing wrong?
Second template argument to std::list should be an allocator, yet you gave it something else - your value, which is int.
As a result, compiler is complaining because int doesn't have any members which allocator should expose.
On a side note, you should make your include files self-sufficient, i.e. they should include all headers they need themselves.

Errors in Xutility after defining _SCL_SECURE_NO_WARNINGS

I am trying to implement a class for calculating the dot product of two vectors.
float dotProduct(vec2 v1, vec2 v2)
{
if (v1.Length() != v2.Length()) { return NULL; }
return (float)std::inner_product(v1.x, v1.y, v2.x, 0.0);
}
When I complie this i get:
Error 1 error C4996: 'std::_Inner_product2': Function call with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++ 'Checked Iterators' C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\numeric 121
So i add #define _SCL_SECURE_NO_WARNINGS
But then I get a bunch of errors in xutility
Error 1 error C2825: '_Iter': must be a class or namespace when followed by '::' C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xutility 371
Error 2 error C2039: 'iterator_category' : is not a member of '`global namespace'' C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xutility 371
Error 3 error C2146: syntax error : missing ';' before identifier 'iterator_category' C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xutility 371
Error 4 error C2602: 'std::iterator_traits<_InIt>::iterator_category' is not a member of a base class of 'std::iterator_traits<_InIt>' C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xutility 371
Error 5 error C2868: 'std::iterator_traits<_InIt>::iterator_category' : illegal syntax for using-declaration; expected qualified-name C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xutility 371
Error 6 error C2825: '_Iter': must be a class or namespace when followed by '::' C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xutility 372
Error 7 error C2039: 'value_type' : is not a member of '`global namespace'' C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xutility 372
Error 8 error C2146: syntax error : missing ';' before identifier 'value_type' C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xutility 372
Error 9 error C2602: 'std::iterator_traits<_InIt>::value_type' is not a member of a base class of 'std::iterator_traits<_InIt>' C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xutility 372
Error 10 error C2868: 'std::iterator_traits<_InIt>::value_type' : illegal syntax for using-declaration; expected qualified-name C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xutility 372
Error 11 error C2825: '_Iter': must be a class or namespace when followed by '::' C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xutility 373
Error 12 error C2039: 'difference_type' : is not a member of '`global namespace'' C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xutility 373
Error 13 error C2146: syntax error : missing ';' before identifier 'difference_type' C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xutility 373
Error 14 error C2602: 'std::iterator_traits<_InIt>::difference_type' is not a member of a base class of 'std::iterator_traits<_InIt>' C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xutility 373
Error 15 error C2868: 'std::iterator_traits<_InIt>::difference_type' : illegal syntax for using-declaration; expected qualified-name C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xutility 373
Error 16 error C2825: '_Iter': must be a class or namespace when followed by '::' C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xutility 375
Error 17 error C2039: 'pointer' : is not a member of '`global namespace'' C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xutility 375
Error 18 error C2146: syntax error : missing ';' before identifier 'pointer' C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xutility 375
Error 19 error C2602: 'std::iterator_traits<_InIt>::pointer' is not a member of a base class of 'std::iterator_traits<_InIt>' C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xutility 375
Error 20 error C2868: 'std::iterator_traits<_InIt>::pointer' : illegal syntax for using-declaration; expected qualified-name C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xutility 375
Error 21 error C2825: '_Iter': must be a class or namespace when followed by '::' C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xutility 376
Error 22 error C2039: 'reference' : is not a member of '`global namespace'' C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xutility 376
Error 23 error C2146: syntax error : missing ';' before identifier 'reference' C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xutility 376
Error 24 error C2602: 'std::iterator_traits<_InIt>::reference' is not a member of a base class of 'std::iterator_traits<_InIt>' C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xutility 376
Error 25 error C2868: 'std::iterator_traits<_InIt>::reference' : illegal syntax for using-declaration; expected qualified-name C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xutility 376
Error 26 error C2665: 'std::_Debug_range2' : none of the 2 overloads could convert all the argument types C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xutility 584
Check the documentation
http://en.cppreference.com/w/cpp/algorithm/inner_product
You are passing values not the iterators. this fuction can create product for longer vectors, so it requires start and end of the data, try this;
std::inner_product(v1.begin(), v1.end(), v2.begin(), 0.0);

Build Error in the "refclock.h" header file, a part of Windows platform SDK

I am building a VC++ solution & using Win& SDK & Win8 SDK (including these paths in LIB & INCLUDE settings of VS2008).
But I am getting the following build error in refclock.h header file.
I don't understand how can we get the error in a standard MSFT header file. Can anyone kindly help me in getting this fixed?
c:\program files\microsoft sdks\windows\v7.0\samples\multimedia\directshow\baseclasses\refclock.h(80) : error C2061: syntax error : identifier 'CAMSchedule'
2>c:\program files\microsoft sdks\windows\v7.0\samples\multimedia\directshow\baseclasses\refclock.h(139) : error C2143: syntax error : missing ';' before '*'
2>c:\program files\microsoft sdks\windows\v7.0\samples\multimedia\directshow\baseclasses\refclock.h(139) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
2>c:\program files\microsoft sdks\windows\v7.0\samples\multimedia\directshow\baseclasses\refclock.h(139) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
2>c:\program files\microsoft sdks\windows\v7.0\samples\multimedia\directshow\baseclasses\refclock.h(139) : warning C4183: 'GetSchedule': missing return type; assumed to be a member function returning 'int'
2>c:\program files\microsoft sdks\windows\v7.0\samples\multimedia\directshow\baseclasses\refclock.h(178) : error C2143: syntax error : missing ';' before '*'
2>c:\program files\microsoft sdks\windows\v7.0\samples\multimedia\directshow\baseclasses\refclock.h(178) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
2>c:\program files\microsoft sdks\windows\v7.0\samples\multimedia\directshow\baseclasses\refclock.h(178) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
2>c:\program files\microsoft sdks\windows\v7.0\samples\multimedia\directshow\baseclasses\refclock.h(139) : error C2065: 'm_pSchedule' : undeclared identifier
2>c:\program files\microsoft sdks\windows\v7.0\samples\multimedia\directshow\baseclasses\refclock.h(166) : error C2065: 'm_pSchedule' : undeclared identifier
2>c:\program files\microsoft sdks\windows\v7.0\samples\multimedia\directshow\baseclasses\refclock.h(166) : error C2227: left of '->GetEvent' must point to class/struct/union/generic type
It's caused by an error in the refclock.h header and the order your include directories are specified in Visual Studio.
You need to have the BaseClasses directory (Samples/Multimedia/DirectShow) before the SDK include directory, since they both have a schedule.h file and refclock.h uses <> not "" for the include.

expected '(' to follow 'WINGDIAPI'

I get the above error and about 101 others (total 102 errors). I searched around and the only solution I found is to include the windows.h library before gl.h. But I am already doing that. So what is the solution? Can anyone help me? I am using glut and opengl. Below is my include process. If you request more of my code let me know
#include <stdio.h> // Standard C/C++ Input-Output
#include <math.h> // Math Functions
#include <windows.h> // Standard Header For MSWindows Applications
#include <GL/gl.h>
#include <time.h>
#include <stdlib.h>
#include "SOIL.h"
and this is the complete error list:
Error 1 error C2054: expected '(' to follow 'WINGDIAPI' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1152
Error 2 error C2085: 'APIENTRY' : not in formal parameter list c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1152
Error 3 error C2146: syntax error : missing ',' before identifier 'glAccum' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1152
Error 4 error C2143: syntax error : missing ';' before '(' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1152
Error 5 error C2059: syntax error : ')' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1152
Error 6 error C2054: expected '(' to follow 'WINGDIAPI' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1153
Error 7 error C2085: 'APIENTRY' : not in formal parameter list c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1153
Error 8 error C2146: syntax error : missing ',' before identifier 'glAlphaFunc' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1153
Error 9 error C2143: syntax error : missing ';' before '(' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1153
Error 10 error C2059: syntax error : ')' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1153
Error 11 error C2054: expected '(' to follow 'WINGDIAPI' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1154
Error 12 error C2085: 'APIENTRY' : not in formal parameter list c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1154
Error 13 error C2146: syntax error : missing ',' before identifier 'glAreTexturesResident' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1154
Error 14 error C2143: syntax error : missing ';' before '(' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1154
Error 15 error C2059: syntax error : ')' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1154
Error 16 error C2054: expected '(' to follow 'WINGDIAPI' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1155
Error 17 error C2085: 'APIENTRY' : not in formal parameter list c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1155
Error 18 error C2146: syntax error : missing ',' before identifier 'glArrayElement' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1155
Error 19 error C2143: syntax error : missing ';' before '(' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1155
Error 20 error C2059: syntax error : ')' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1155
Error 21 error C2054: expected '(' to follow 'WINGDIAPI' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1156
Error 22 error C2085: 'APIENTRY' : not in formal parameter list c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1156
Error 23 error C2146: syntax error : missing ',' before identifier 'glBegin' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1156
Error 24 error C2143: syntax error : missing ';' before '(' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1156
Error 25 error C2059: syntax error : ')' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1156
Error 26 error C2054: expected '(' to follow 'WINGDIAPI' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1157
Error 27 error C2085: 'APIENTRY' : not in formal parameter list c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1157
Error 28 error C2146: syntax error : missing ',' before identifier 'glBindTexture' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1157
Error 29 error C2143: syntax error : missing ';' before '(' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1157
Error 30 error C2059: syntax error : ')' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1157
Error 31 error C2054: expected '(' to follow 'WINGDIAPI' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1158
Error 32 error C2085: 'APIENTRY' : not in formal parameter list c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1158
Error 33 error C2146: syntax error : missing ',' before identifier 'glBitmap' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1158
Error 34 error C2143: syntax error : missing ';' before '(' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1158
Error 35 error C2059: syntax error : ')' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1158
Error 36 error C2054: expected '(' to follow 'WINGDIAPI' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1159
Error 37 error C2085: 'APIENTRY' : not in formal parameter list c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1159
Error 38 error C2146: syntax error : missing ',' before identifier 'glBlendFunc' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1159
Error 39 error C2143: syntax error : missing ';' before '(' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1159
Error 40 error C2059: syntax error : ')' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1159
Error 41 error C2054: expected '(' to follow 'WINGDIAPI' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1160
Error 42 error C2085: 'APIENTRY' : not in formal parameter list c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1160
Error 43 error C2146: syntax error : missing ',' before identifier 'glCallList' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1160
Error 44 error C2143: syntax error : missing ';' before '(' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1160
Error 45 error C2059: syntax error : ')' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1160
Error 46 error C2054: expected '(' to follow 'WINGDIAPI' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1161
Error 47 error C2085: 'APIENTRY' : not in formal parameter list c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1161
Error 48 error C2146: syntax error : missing ',' before identifier 'glCallLists' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1161
Error 49 error C2143: syntax error : missing ';' before '(' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1161
Error 50 error C2059: syntax error : ')' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1161
Error 51 error C2054: expected '(' to follow 'WINGDIAPI' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1162
Error 52 error C2085: 'APIENTRY' : not in formal parameter list c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1162
Error 53 error C2146: syntax error : missing ',' before identifier 'glClear' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1162
Error 54 error C2143: syntax error : missing ';' before '(' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1162
Error 55 error C2059: syntax error : ')' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1162
Error 56 error C2054: expected '(' to follow 'WINGDIAPI' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1163
Error 57 error C2085: 'APIENTRY' : not in formal parameter list c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1163
Error 58 error C2146: syntax error : missing ',' before identifier 'glClearAccum' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1163
Error 59 error C2143: syntax error : missing ';' before '(' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1163
Error 60 error C2059: syntax error : ')' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1163
Error 61 error C2054: expected '(' to follow 'WINGDIAPI' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1164
Error 62 error C2085: 'APIENTRY' : not in formal parameter list c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1164
Error 63 error C2146: syntax error : missing ',' before identifier 'glClearColor' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1164
Error 64 error C2143: syntax error : missing ';' before '(' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1164
Error 65 error C2059: syntax error : ')' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1164
Error 66 error C2054: expected '(' to follow 'WINGDIAPI' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1165
Error 67 error C2085: 'APIENTRY' : not in formal parameter list c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1165
Error 68 error C2146: syntax error : missing ',' before identifier 'glClearDepth' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1165
Error 69 error C2143: syntax error : missing ';' before '(' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1165
Error 70 error C2059: syntax error : ')' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1165
Error 71 error C2054: expected '(' to follow 'WINGDIAPI' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1166
Error 72 error C2085: 'APIENTRY' : not in formal parameter list c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1166
Error 73 error C2146: syntax error : missing ',' before identifier 'glClearIndex' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1166
Error 74 error C2143: syntax error : missing ';' before '(' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1166
Error 75 error C2059: syntax error : ')' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1166
Error 76 error C2054: expected '(' to follow 'WINGDIAPI' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1167
Error 77 error C2085: 'APIENTRY' : not in formal parameter list c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1167
Error 78 error C2146: syntax error : missing ',' before identifier 'glClearStencil' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1167
Error 79 error C2143: syntax error : missing ';' before '(' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1167
Error 80 error C2059: syntax error : ')' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1167
Error 81 error C2054: expected '(' to follow 'WINGDIAPI' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1168
Error 82 error C2085: 'APIENTRY' : not in formal parameter list c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1168
Error 83 error C2146: syntax error : missing ',' before identifier 'glClipPlane' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1168
Error 84 error C2143: syntax error : missing ';' before '(' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1168
Error 85 error C2059: syntax error : ')' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1168
Error 86 error C2054: expected '(' to follow 'WINGDIAPI' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1169
Error 87 error C2085: 'APIENTRY' : not in formal parameter list c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1169
Error 88 error C2146: syntax error : missing ',' before identifier 'glColor3b' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1169
Error 89 error C2143: syntax error : missing ';' before '(' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1169
Error 90 error C2059: syntax error : ')' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1169
Error 91 error C2054: expected '(' to follow 'WINGDIAPI' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1170
Error 92 error C2085: 'APIENTRY' : not in formal parameter list c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1170
Error 93 error C2146: syntax error : missing ',' before identifier 'glColor3bv' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1170
Error 94 error C2143: syntax error : missing ';' before '(' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1170
Error 95 error C2059: syntax error : ')' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1170
Error 96 error C2054: expected '(' to follow 'WINGDIAPI' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1171
Error 97 error C2085: 'APIENTRY' : not in formal parameter list c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1171
Error 98 error C2146: syntax error : missing ',' before identifier 'glColor3d' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1171
Error 99 error C2143: syntax error : missing ';' before '(' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1171
Error 100 error C2059: syntax error : ')' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1171
Error 101 error C2054: expected '(' to follow 'WINGDIAPI' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1172
Error 102 error C1003: error count exceeds 100; stopping compilation c:\program files (x86)\microsoft sdks\windows\v7.0a\include\gl\gl.h 1172
This is commonly caused by defining WIN32_LEAN_AND_MEAN, either in stdafx.h or in the compilation settings.
Defining that macro before including windows.h automatically excludes infrequently used header files and definitions.
Since you are using OpenGL you are using some of those infrequently used headers, so you need to turn that off.
It may appear in a header such as stdafx.h like so:
#define WIN32_LEAN_AND_MEAN
Or it may be in the compilation settings like so:
-DWIN32_LEAN_AND_MEAN
You forget to include windows.h right before gl.h. From http://www.opengl.org/archives/resources/faq/technical/gettingstarted.htm:
Error:
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1152) : error C2054: expected '(' to
follow 'WINGDIAPI'
c:\program files\microsoft visual studio\vc98\include\gl\gl.h(1152) : error C2085: 'APIENTRY' : not in
formal parameter list
Didn't #include windows.h or included it after gl.h. Source files that
use neither GLUT nor MFC, but which make calls to OpenGL, should:
#include <windows.h>
#include <GL/gl.h>
Works for me.
Also, make sure you are not using precompiled header
OK I had the same problem and i fixed it . Just Make sure you dont have other files in your project (precompiled header /.c/ .cpp).Delete them and leave only thouse wich you need and it will work
It seems like you are using the SOIL library. Make sure that windows.h is included (the preprocessor might take a different branch). Ensure that WIN32 is defined if you do not want to change the SOIL library. If not, you can replace it by _WIN32.
This all seems to be pretty much wrong guys (sorry!).
Simply because this loudly proclaims that
including windows.h is needed does not mean that
including windows.h should be done.
OpenGL is an OPEN STANDARD PROTOCOL INTERFACE SPEC. Thus,
its related STANDARD headers (GL/gl.h , GL/glu.h etc.) should DEFINITELY NOT be causing massive pollution with
whichever proprietary crap some proprietary vendors manage to come up with.
Specifically, I am talking of
woefully Win32-specific macros WINGDIAPI and APIENTRY, which
have been ADDED TO
previously standard GL header content (hint: see SGI text in that header), and which
cause these GL headers to NOT be a properly self-contained and generic interface any more!!
(i.e., requiring a whole ton of wingdi.h and kitchen sink etc., with the massive consequence of globally polluting your entire source code scope with this wholly environment-specific crap, windows.h etc)
Thus, to rectify this dire situation, things likely should be done like this:
create purpose-specific local headers which try to do a maximally precise job of
supplying these few required-but-missing (non-self-contained header!) environment-specific parts:
APIENTRY definition header file
WINGDIAPI definition header file
supply these missing parts (broken since non-self-contained OpenGL interface...) by including these helper headers everywhere that you include related official GL headers (interfaces!) - on the Windows-proprietary platform only (#ifdef _WIN32)!
take uttermost care to keep any and all Windows-proprietary transition-to-OpenGL helpers (those which make use of Win32 HDC etc., e.g. wgl*() APIs) handling to their own properly strictly isolated translation unit (.cpp)
keep all of your standard / generic / cross-platform / universal (read: innocent ;-)) OpenGL implementation handling parts to their own translation units (thus, cleanly NOT infected by environment-specific windows.h crap, thus properly working on all platforms)
profit! (hopefully)
Topically related reference (potentially already helpful):
github WindowsHModular
Topically related stuff:
Win32 min / max macro "namespace" / symbol pollution (early-define NOMINMAX and prefer using __min / __max where still needed)
Win32 near / far macros
The fact remains that it is very intrusive behaviour to be polluting a standard, minimalist(?) interface (OpenGL) with negligible parts (in this case, symbol export macros) of a factually foreign toolkit, thereby necessitating sufficiently (header-side!) global-scope pollution of supposedly generic user code with wholly environment-specific crap: windows.h (as opposed to simply ensuring that these public interface headers have their own compiler-specific symbol export macros provided within scope already).
tl;dr: "One platform enabled, eleven platforms broken - job achieved"