I am having a problem with VS2010 (and VS2008) giving my a great list of syntax errors. However, the syntax is indeed correct. Here is a small example;
I have the following code block inside a .h file
// Prototype Declarations
LIST* createList (int (*compare) (void*, void*));
LIST* destroyList (LIST* plist);
int addNode (LIST* pList, void* dataInPtr);
bool removeNode (LIST* pList, void* keyPtr, void** dataOutPtr);
bool searchList (LIST* pList, void* pArgu, void** pDataOut);
bool retrieveNode (LIST* pList, void* pArgu, void** dataOutPtr);
bool traverse (LIST* pList, int fromWhere, void** dataOutPtr);
int listCount (LIST* pList);
bool isListEmpty (LIST* pList);
bool isListFull (LIST* pList);
LIST is a typedef'd struct, FYI. All of these function declarations appear to be correct syntax. Yet, when attempting to build, I get the following syntax errors starting at the first bool function, going down the list.
Error 2 error C2059: syntax error : ';'
I'm failing to see where the problem lies. Again, this is just a small example. I also receive syntax errors such as the following
bool found;
Error 29 error C2065: 'bool' : undeclared identifier
I'm truly at a lost on this one. The code posted here isn't my own, it's from a data structures book, but again it looks correct. Any help would be appreciated. Thanks!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…