compile error on simple code , plz help

eric lin ericlin@fsshl.zzn.com
Sat May 14 01:34:00 GMT 2011


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

so plz help
sincerely, Eric Lin, in USA-US citizen
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fixed_pt.cpp
Type: application/octet-stream
Size: 1609 bytes
Desc: fixed_pt.cpp
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20110514/966e5429/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fixed_pt.h
Type: application/octet-stream
Size: 8001 bytes
Desc: fixed_pt.h
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20110514/966e5429/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fixed_test.cpp
Type: application/octet-stream
Size: 790 bytes
Desc: fixed_test.cpp
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20110514/966e5429/attachment-0002.obj>


More information about the Gcc mailing list