Hi,
I have this #define :
#define TRACE_IT(AA) TRACE(__FILE__ , __FUNCTION__, __LINE__, AA)
With is use in several functions like this :
TRACE_IT ("some text");
TRACE is a function which looks like this :
void TRACE(const char * const file, const char * const function, long lineNumber, ostream& text1);
void TRACE (const char * const argFile, const char * const argFunction, long argLineNumber, ostream& argText1) {
cout << " " << argFile << " - " << argFunction << " - " << argLineNumber;
cout << " ";
cout << argText1;
cout << "\n";
}
On the line :
TRACE_IT ("some text");
the compiler gives an error : expected a ";"
Does anybody know what's wrong ?
I also tried it with the define like this :
#define TRACE_IT(AA) TRACE(__FILE__ , __FUNCTION__, __LINE__, << AA)
Same compile error.
In the end I wanna use it like this
TRACE_IT ("some text");
TRACE_IT("\"some text: \" << err");
Thanks.
TRACE's last parameter is of type std::ostream& but you pass in a string.