"eric lin" <eric...@fsshl.zzn.com> writes: > eric@eric-laptop:~/practicalCpp$ g++ fixed_pt.cpp fixed_test.cpp > In file included from fixed_pt.cpp:3: > fixed_pt.h:211: error: ‘fixed_pt::fixed_pt > fixed_pt::fixed_pt::operator+(const fixed_pt::fixed_pt&, const > fixed_pt::fixed_pt&)’ must take either zero or one argument > fixed_pt.h:216: error: ‘fixed_pt::fixed_pt > fixed_pt::fixed_pt::operator+(const fixed_pt::fixed_pt&, double)’ must take > either zero or one argument > fixed_pt.h:221: error: ‘fixed_pt::fixed_pt > fixed_pt::fixed_pt::operator+(double, const fixed_pt::fixed_pt&)’ must take > either zero or one argument > fixed_pt.h:226: error: ‘fixed_pt::fixed_pt > fixed_pt::fixed_pt::operator-(const fixed_pt::fixed_pt&, const > fixed_pt::fixed_pt&)’ must take either zero or one argument > fixed_pt.h:231: error: ‘fixed_pt::fixed_pt > fixed_pt::fixed_pt::operator-(const fixed_pt::fixed_pt&, double)’ must take > either zero or one argument > fixed_pt.h:236: error: ‘fixed_pt::fixed_pt > fixed_pt::fixed_pt::operator-(double, const fixed_pt::fixed_pt&)’ must take > either zero or one argument > fixed_pt.h:241: error: ‘fixed_pt::fixed_pt > fixed_pt::fixed_pt::operator*(const fixed_pt::fixed_pt&, const > fixed_pt::fixed_pt&)’ must take either zero or one argument > fixed_pt.h:246: error: ‘fixed_pt::fixed_pt > fixed_pt::fixed_pt::operator*(const fixed_pt::fixed_pt&, double)’ must take > either zero or one argument > ------------------- > I just copy a couple lines of compiler result from my g++ > all three files fixed_pt > fixed_test > are copied from a book > practical c++ programming
This is the wrong mailing list. The list gcc@gcc.gnu.org is for discussions about the development of gcc itself. This message would be OK on gcc-h...@gcc.gnu.org. Please take any followups to gcc-help. Thanks. In this case you are really just asking a basic C++ question. And I think you must truncated the list of error messages, because there are basic syntax errors in your code. static long int double_to_fp(const double the_double) { return ( static_cast<long int>{ the_double * static_cast<double>(fixed_exp) + fixed_fudge_factor)); } In "static_cast<long int>{" the '{' should be a '('. fixed_pt& operaotr ++() { "operator" is misspelled. Etc. You need to fix these problems first. Ian