Hi all, I'm hoping someone that actually knows c++ can help me with this; I've never programmed in c++ but my current task is porting a c++ program from unix to windows (dos command line really) and while I've gotten to where I'm compiling it in dos, I get the error "parse error before 'if'" in one of the header files. The code looks like this:
Code:
#ifndef __TRACE__
#define __TRACE__
#include <iostream>
/* global Variable of Trace-Level */
extern int TraceLevel;
#ifndef NDEBUG
#define Trace(Level, Output) \
if (Level <= TraceLevel) { //parsing error on this line
cout << Output << endl << flush;
}
#define TraceIf( Condition, Level, Output) \
if ((Condition) && (Level <= TraceLevel) ) {
cout << Output << endl << flush;
}
...
and it's being called from this method in another header file:
Code:
CPairDict<T1,T2>::~CPairDict() {
Trace(2, "Enter CPairDict<T1,T2>::~CPairDict()");
clear();
Trace(2, "Leave CPairDict<T1,T2>::~CPairDict()");
}
As I said, I barely know any c++, so whatever is wrong with this code eludes me (it compiles and runs fine under both unix and cygwin) since I didn't write it to begin with and barely know what it does. Any help would be really appreciated.