This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: operator<< overload question
- From: Ian Lance Taylor <ian at wasabisystems dot com>
- To: gcc at atoka-software dot com
- Cc: gcc-help at gcc dot gnu dot org
- Date: 27 Dec 2003 13:00:58 -0500
- Subject: Re: operator<< overload question
- References: <200312270931.11993.gcc@atoka-software.com>
Allen Wayne Best <gcc@atoka-software.com> writes:
> g++ -g -O2 -o motor motor.o sensor.o
> motor.o(.text+0x7cd): In function `main':
> /home/best/engine-project/control-module/project/src/motor.cpp:67: undefined
> reference to `Measure::operator<<(std::basic_ostream<char,
> std::char_traits<char> >&, Measure::Sensor const&)'
> collect2: ld returned 1 exit status
>
> any suggestions are greatly appreciated! tia!
I suggest that you put together a complete test case in a single file,
rather than using piece-meal bits. You haven't provided enough
information to show what has gone wrong.
In particular, the error message refers to Measure, which was not in
your sample code at all, but may be an important part of the problem.
Ian