C Board  

Go Back   C Board > General Programming Boards > C++ Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 12-02-2007, 03:14 PM   #1
Registered User
 
Join Date: Dec 2007
Posts: 19
failure to import external C libraries in C++ project

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)

....
nocturna_gr is offline   Reply With Quote
Old 12-02-2007, 03:33 PM   #2
Senior software engineer
 
brewbuck's Avatar
 
Join Date: Mar 2007
Location: Portland, OR
Posts: 5,381
Didn't the repetitious nature of those errors clue you in that you possibly didn't have to post ALL that crap?
brewbuck is offline   Reply With Quote
Old 12-02-2007, 03:35 PM   #3
Mysterious C++ User
 
Join Date: Oct 2007
Posts: 14,099
No, we have no idea because you've supplied no code to tell us what you're doing.
Elysia is offline   Reply With Quote
Old 12-02-2007, 03:49 PM   #4
and the hat of sweating
 
Join Date: Aug 2007
Location: Toronto, ON
Posts: 3,120
The first few are obvious. ok.h is doing #define BLAH, but BLAH was already #defined...
For the others, just search for the error code. The MSDN usually tells you what caused it and how to fix it.
Ex. C4430:
http://msdn2.microsoft.com/en-us/lib...96(VS.80).aspx
cpjust is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
QT and external libraries Quacker Linux Programming 1 04-08-2003 07:02 AM
Unresolved external symbols in OGL Shadow12345 Game Programming 4 08-04-2002 09:46 PM
error LNK2001: unresolved external symbol Unregistered C Programming 12 07-12-2002 08:45 PM
DJGPP project problems Bubba A Brief History of Cprogramming.com 4 06-08-2002 07:16 PM
external errors on project files? Know what they are but why are they happening here. G'n'R C++ Programming 2 01-01-2002 09:03 AM


All times are GMT -6. The time now is 11:36 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0 RC2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22