greetings,
i hope someone here has a clue, because i've been scratching my head over this one.
i'm working on a c++ app and i've got my function prototypes defined in a header file (prototypes.h). when i try to compile the code g++ chokes on any prototype that uses ofstream as a return type or input type. when i try to compile i get the following error output:
Code:
In file included from fileio.cpp:11:
prototypes.h:15: error: syntax error before `*' token
prototypes.h:16: error: `ofstream' was not declared in this scope
prototypes.h:16: error: parse error before `,' token
the lines that it refers to are:
Code:
ofstream* openAppendFile(); // open file for appending
void appendToFile(ofstream*, char*); // append string to file
afaik, this is valid code. and what makes it all the more frustrating is that while the code won't compile on any of my systems (all slackware 10.1), it compiles w/o even a smart remark on my buddy's slackware 8.1 machine. unfortunately i don't have any other distributions/versions on which to try the build, so i can't tell whether the problem is with 10.1 or not.
i am still in the process of learning c++ so forgive me if i'm not seeing the totally obvious.