Hi,
i use Visual Studio 2005 and i am trying to import some C libs statically in C++ code. In my StdAfx.h, i include the following:
Code:
...
extern "C"{

#include <ok.h>

#include <scardcl.h>

}
...

As soon as i try to compile, i get the following errors. Does anyone suspect what is going on?
Code:
....

StdAfx.cpp

WINVER not defined. Defaulting to 0x0502 (Windows Server 2003)

C:\Omnikey\Include\ok.h(345) : warning C4005: 'FAR' : macro redefinition

C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\windef.h(145) : see previous definition of 'FAR'

C:\Omnikey\Include\ok.h(346) : warning C4005: 'NEAR' : macro redefinition

C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\windef.h(146) : see previous definition of 'NEAR'

C:\Omnikey\Include\ok.h(359) : warning C4005: 'PASCAL' : macro redefinition

C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\windef.h(127) : see previous definition of 'PASCAL'

C:\Omnikey\Include\ok.h(437) : error C2371: 'LONG64' : redefinition; different basic types

C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\basetsd.h(418) : see declaration of 'LONG64'

C:\Omnikey\Include\ok.h(514) : error C2371: 'ULONG64' : redefinition; different basic types

C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\basetsd.h(425) : see declaration of 'ULONG64'

C:\Omnikey\Include\ok.h(585) : error C2143: syntax error : missing ';' before '*'

C:\Omnikey\Include\ok.h(585) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

C:\Omnikey\Include\ok.h(588) : error C2143: syntax error : missing ';' before '*'

C:\Omnikey\Include\ok.h(588) : error C2371: '_far' : redefinition; different basic types

C:\Omnikey\Include\ok.h(585) : see declaration of '_far'

C:\Omnikey\Include\ok.h(588) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

C:\Omnikey\Include\ok.h(676) : error C2143: syntax error : missing ';' before '*'

C:\Omnikey\Include\ok.h(676) : error C2373: '_far' : redefinition; different type modifiers

C:\Omnikey\Include\ok.h(585) : see declaration of '_far'

C:\Omnikey\Include\ok.h(676) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

C:\Omnikey\Include\ok.h(676) : error C2377: 'PLONG64' : redefinition; typedef cannot be overloaded with any other symbol

C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\basetsd.h(418) : see declaration of 'PLONG64'

C:\Omnikey\Include\ok.h(679) : error C2143: syntax error : missing ';' before '*'

C:\Omnikey\Include\ok.h(679) : error C2373: '_far' : redefinition; different type modifiers

C:\Omnikey\Include\ok.h(585) : see declaration of '_far'

C:\Omnikey\Include\ok.h(679) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

C:\Omnikey\Include\ok.h(679) : error C2377: 'PULONG64' : redefinition; typedef cannot be overloaded with any other symbol

C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\basetsd.h(425) : see declaration of 'PULONG64'

C:\Omnikey\Include\ok.h(689) : error C2143: syntax error : missing ';' before '*'

C:\Omnikey\Include\ok.h(689) : error C2373: '_far' : redefinition; different type modifiers

C:\Omnikey\Include\ok.h(585) : see declaration of '_far'

C:\Omnikey\Include\ok.h(689) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

C:\Omnikey\Include\ok.h(692) : error C2143: syntax error : missing ';' before '*'

C:\Omnikey\Include\ok.h(692) : error C2373: '_far' : redefinition; different type modifiers

C:\Omnikey\Include\ok.h(585) : see declaration of '_far'

C:\Omnikey\Include\ok.h(692) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

C:\Omnikey\Include\ok.h(696) : error C2143: syntax error : missing ';' before '*'

C:\Omnikey\Include\ok.h(696) : error C2373: '_far' : redefinition; different type modifiers

C:\Omnikey\Include\ok.h(585) : see declaration of '_far'

C:\Omnikey\Include\ok.h(696) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

C:\Omnikey\Include\ok.h(698) : error C2143: syntax error : missing ';' before '*'

C:\Omnikey\Include\ok.h(698) : error C2373: '_far' : redefinition; different type modifiers

C:\Omnikey\Include\ok.h(585) : see declaration of '_far'

C:\Omnikey\Include\ok.h(698) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

C:\Omnikey\Include\ok.h(700) : error C2143: syntax error : missing ';' before '*'

C:\Omnikey\Include\ok.h(700) : error C2373: '_far' : redefinition; different type modifiers

C:\Omnikey\Include\ok.h(585) : see declaration of '_far'

C:\Omnikey\Include\ok.h(700) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

C:\Omnikey\Include\ok.h(942) : error C2143: syntax error : missing ';' before '*'

C:\Omnikey\Include\ok.h(942) : error C2373: '_far' : redefinition; different type modifiers

C:\Omnikey\Include\ok.h(585) : see declaration of '_far'

C:\Omnikey\Include\ok.h(942) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

C:\Omnikey\Include\ok.h(943) : error C2143: syntax error : missing ';' before '*'

C:\Omnikey\Include\ok.h(943) : error C2373: '_far' : redefinition; different type modifiers

C:\Omnikey\Include\ok.h(585) : see declaration of '_far'

C:\Omnikey\Include\ok.h(943) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

C:\Omnikey\Include\ok.h(944) : error C2143: syntax error : missing ';' before '*'

C:\Omnikey\Include\ok.h(944) : error C2373: '_far' : redefinition; different type modifiers

C:\Omnikey\Include\ok.h(585) : see declaration of '_far'

C:\Omnikey\Include\ok.h(944) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

C:\Omnikey\Include\ok.h(961) : error C2143: syntax error : missing ';' before '*'

C:\Omnikey\Include\ok.h(961) : error C2373: '_far' : redefinition; different type modifiers

C:\Omnikey\Include\ok.h(585) : see declaration of '_far'

C:\Omnikey\Include\ok.h(961) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

C:\Omnikey\Include\ok.h(962) : error C2143: syntax error : missing ';' before '*'

C:\Omnikey\Include\ok.h(962) : error C2373: '_far' : redefinition; different type modifiers

C:\Omnikey\Include\ok.h(585) : see declaration of '_far'

C:\Omnikey\Include\ok.h(962) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

C:\Omnikey\Include\ok.h(963) : error C2143: syntax error : missing ';' before '*'

C:\Omnikey\Include\ok.h(963) : error C2373: '_far' : redefinition; different type modifiers

C:\Omnikey\Include\ok.h(585) : see declaration of '_far'

C:\Omnikey\Include\ok.h(963) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

C:\Omnikey\Include\ok.h(1208) : error C2143: syntax error : missing ';' before '*'

C:\Omnikey\Include\ok.h(1208) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

C:\Omnikey\Include\ok.h(1209) : error C2143: syntax error : missing ';' before '*'

C:\Omnikey\Include\ok.h(1209) : error C2371: '_far' : redefinition; different basic types

C:\Omnikey\Include\ok.h(585) : see declaration of '_far'

C:\Omnikey\Include\ok.h(1209) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

C:\Omnikey\Include\ok.h(1210) : error C2143: syntax error : missing ';' before '*'

C:\Omnikey\Include\ok.h(1210) : error C2373: '_far' : redefinition; different type modifiers

C:\Omnikey\Include\ok.h(585) : see declaration of '_far'

C:\Omnikey\Include\ok.h(1210) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

C:\Omnikey\Include\ok.h(1211) : error C2143: syntax error : missing ';' before '*'

C:\Omnikey\Include\ok.h(1211) : error C2373: '_far' : redefinition; different type modifiers

C:\Omnikey\Include\ok.h(585) : see declaration of '_far'

C:\Omnikey\Include\ok.h(1211) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

C:\Omnikey\Include\ok.h(1212) : error C2143: syntax error : missing ';' before '*'

C:\Omnikey\Include\ok.h(1212) : error C2373: '_far' : redefinition; different type modifiers

C:\Omnikey\Include\ok.h(585) : see declaration of '_far'

C:\Omnikey\Include\ok.h(1212) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

C:\Omnikey\Include\ok.h(1213) : error C2143: syntax error : missing ';' before '*'

C:\Omnikey\Include\ok.h(1213) : error C2373: '_far' : redefinition; different type modifiers

C:\Omnikey\Include\ok.h(585) : see declaration of '_far'

C:\Omnikey\Include\ok.h(1213) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

C:\Omnikey\Include\ok.h(1214) : error C2143: syntax error : missing ';' before '*'

C:\Omnikey\Include\ok.h(1214) : error C2373: '_far' : redefinition; different type modifiers

C:\Omnikey\Include\ok.h(585) : see declaration of '_far'

C:\Omnikey\Include\ok.h(1214) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

C:\Omnikey\Include\ok.h(1215) : error C2143: syntax error : missing ';' before '*'

C:\Omnikey\Include\ok.h(1215) : error C2373: '_far' : redefinition; different type modifiers

C:\Omnikey\Include\ok.h(585) : see declaration of '_far'

C:\Omnikey\Include\ok.h(1215) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

C:\Omnikey\Include\ok.h(1216) : error C2143: syntax error : missing ';' before '*'

C:\Omnikey\Include\ok.h(1216) : error C2373: '_far' : redefinition; different type modifiers

C:\Omnikey\Include\ok.h(585) : see declaration of '_far'

C:\Omnikey\Include\ok.h(1216) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

C:\Omnikey\Include\ok.h(1217) : error C2143: syntax error : missing ';' before '*'

C:\Omnikey\Include\ok.h(1217) : error C2373: '_far' : redefinition; different type modifiers

C:\Omnikey\Include\ok.h(585) : see declaration of '_far'

C:\Omnikey\Include\ok.h(1217) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

C:\Omnikey\Include\ok.h(1218) : error C2143: syntax error : missing ';' before '*'

C:\Omnikey\Include\ok.h(1218) : error C2373: '_far' : redefinition; different type modifiers

C:\Omnikey\Include\ok.h(585) : see declaration of '_far'

C:\Omnikey\Include\ok.h(1218) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

C:\Omnikey\Include\ok.h(1219) : error C2143: syntax error : missing ';' before '*'

C:\Omnikey\Include\ok.h(1219) : error C2373: '_far' : redefinition; different type modifiers

C:\Omnikey\Include\ok.h(585) : see declaration of '_far'

C:\Omnikey\Include\ok.h(1219) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

C:\Omnikey\Include\ok.h(1220) : error C2143: syntax error : missing ';' before '*'

C:\Omnikey\Include\ok.h(1220) : error C2373: '_far' : redefinition; different type modifiers

C:\Omnikey\Include\ok.h(585) : see declaration of '_far'

C:\Omnikey\Include\ok.h(1220) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

C:\Omnikey\Include\ok.h(1223) : error C2143: syntax error : missing ';' before '*'

C:\Omnikey\Include\ok.h(1223) : error C2373: '_far' : redefinition; different type modifiers

C:\Omnikey\Include\ok.h(585) : see declaration of '_far'

C:\Omnikey\Include\ok.h(1223) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

C:\Omnikey\Include\ok.h(1225) : error C2143: syntax error : missing ';' before '*'

C:\Omnikey\Include\ok.h(1225) : error C2373: '_far' : redefinition; different type modifiers

C:\Omnikey\Include\ok.h(585) : see declaration of '_far'

C:\Omnikey\Include\ok.h(1225) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

C:\Omnikey\Include\ok.h(1226) : error C2143: syntax error : missing ';' before '*'

C:\Omnikey\Include\ok.h(1226) : error C2373: '_far' : redefinition; different type modifiers

C:\Omnikey\Include\ok.h(585) : see declaration of '_far'

C:\Omnikey\Include\ok.h(1226) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

C:\Omnikey\Include\ok.h(1227) : error C2143: syntax error : missing ';' before '*'

C:\Omnikey\Include\ok.h(1227) : error C2373: '_far' : redefinition; different type modifiers

C:\Omnikey\Include\ok.h(585) : see declaration of '_far'

C:\Omnikey\Include\ok.h(1227) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

C:\Omnikey\Include\ok.h(1230) : error C2143: syntax error : missing ';' before '*'

C:\Omnikey\Include\ok.h(1230) : error C2373: '_far' : redefinition; different type modifiers

C:\Omnikey\Include\ok.h(585) : see declaration of '_far'

C:\Omnikey\Include\ok.h(1230) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

C:\Omnikey\Include\ok.h(1231) : error C2143: syntax error : missing ';' before '*'

C:\Omnikey\Include\ok.h(1231) : error C2373: '_far' : redefinition; different type modifiers

C:\Omnikey\Include\ok.h(585) : see declaration of '_far'

C:\Omnikey\Include\ok.h(1231) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

C:\Omnikey\Include\ok.h(1232) : error C2143: syntax error : missing ';' before '*'

C:\Omnikey\Include\ok.h(1232) : error C2373: '_far' : redefinition; different type modifiers

C:\Omnikey\Include\ok.h(585) : see declaration of '_far'

C:\Omnikey\Include\ok.h(1232) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

C:\Omnikey\Include\ok.h(1233) : error C2143: syntax error : missing ';' before '*'

...

C:\Omnikey\Include\ok.h(1241) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

C:\Omnikey\Include\ok.h(1243) : error C2143: syntax error : missing ';' before '*'

C:\Omnikey\Include\ok.h(1243) : error C2373: '_far' : redefinition; different type modifiers

C:\Omnikey\Include\ok.h(585) : see declaration of '_far'

C:\Omnikey\Include\ok.h(1243) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

C:\Omnikey\Include\ok.h(1244) : error C2143: syntax error : missing ';' before '*'

C:\Omnikey\Include\ok.h(1244) : error C2373: '_far' : redefinition; different type modifiers

C:\Omnikey\Include\ok.h(585) : see declaration of '_far'
....

C:\Omnikey\Include\ok.h(1247) : error C2373: '_far' : redefinition; different type modifiers

C:\Omnikey\Include\ok.h(585) : see declaration of '_far'

C:\Omnikey\Include\ok.h(1247) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

C:\Omnikey\Include\ok.h(1261) : error C2143: syntax error : missing ';' before '*'

C:\Omnikey\Include\ok.h(1261) : error C2373: '_far' : redefinition; different type modifiers

C:\Omnikey\Include\ok.h(585) : see declaration of '_far'

C:\Omnikey\Include\ok.h(1261) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

C:\Omnikey\Include\ok.h(1263) : error C2143: syntax error : missing ';' before '*'

C:\Omnikey\Include\ok.h(1263) : error C2373: '_far' : redefinition; different type modifiers

C:\Omnikey\Include\ok.h(585) : see declaration of '_far'

C:\Omnikey\Include\ok.h(1263) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

C:\Omnikey\Include\ok.h(1268) : error C2143: syntax error : missing ';' before '*'

C:\Omnikey\Include\ok.h(1268) : error C2373: '_far' : redefinition; different type modifiers

C:\Omnikey\Include\ok.h(585) : see declaration of '_far'

C:\Omnikey\Include\ok.h(1268) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

C:\Omnikey\Include\ok.h(1284) : error C2143: syntax error : missing ';' before '*'

C:\Omnikey\Include\ok.h(1284) : error C2373: '_far' : redefinition; different type modifiers

C:\Omnikey\Include\ok.h(585) : see declaration of '_far'

C:\Omnikey\Include\ok.h(1284) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

C:\Omnikey\Include\ok.h(1294) : error C2143: syntax error : missing ';' before '*'

C:\Omnikey\Include\ok.h(1294) : error C2373: '_far' : redefinition; different type modifiers

C:\Omnikey\Include\ok.h(585) : see declaration of '_far'

C:\Omnikey\Include\ok.h(1294) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

C:\Omnikey\Include\ok.h(1296) : error C2143: syntax error : missing ';' before '*'

C:\Omnikey\Include\ok.h(1296) : error C2373: '_far' : redefinition; different type modifiers

C:\Omnikey\Include\ok.h(585) : see declaration of '_far'

C:\Omnikey\Include\ok.h(1296) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

C:\Omnikey\Include\scardcl.h(46) : error C2146: syntax error : missing ';' before identifier '_pascal'

C:\Omnikey\Include\scardcl.h(46) : error C2377: '_far' : redefinition; typedef cannot be overloaded with any other symbol

C:\Omnikey\Include\ok.h(585) : see declaration of '_far'

C:\Omnikey\Include\scardcl.h(46) : error C2146: syntax error : missing ';' before identifier '_loadds'

C:\Omnikey\Include\scardcl.h(46) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

C:\Omnikey\Include\scardcl.h(46) : error C2146: syntax error : missing ';' before identifier 'SCardCLWriteMifareKeyToReader'

C:\Omnikey\Include\scardcl.h(46) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

C:\Omnikey\Include\scardcl.h(54) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

C:\Omnikey\Include\scardcl.h(57) : error C2146: syntax error : missing ';' before identifier '_pascal'

C:\Omnikey\Include\scardcl.h(57) : fatal error C1003: error count exceeds 100; stopping compilation

Main.cpp

WINVER not defined. Defaulting to 0x0502 (Windows Server 2003)

....