[Gllug] c++ newbie complier probs
Pete Ryland
pdr at pdr.cx
Tue Oct 22 19:14:15 UTC 2002
On Tue, Oct 22, 2002 at 08:43:25PM +0100, Sean Burlington wrote:
> I am using gcc 3.1
> /usr/local/bin/g++ -Wall \
> -I/home/sean/projects/c++/bb/horstman/cccfiles/ 4.cpp
>
> and get the following output
> (I'm confused - other programs using the same included files work fine
> I think I am missing something obvious )
>
> /tmp/ccLFm4QL.o: In function `same_name(Employee, Employee)':
> /tmp/ccLFm4QL.o(.text+0x18): undefined reference to
> `Employee::get_name() const'
> /tmp/ccLFm4QL.o(.text+0x2a): undefined reference to
> `Employee::get_name() const'
> /tmp/ccLFm4QL.o: In function `main':
> /tmp/ccLFm4QL.o(.text+0xf8): undefined reference to
> `Employee::Employee[in-charge](std::basic_string<char,
> std::char_traits<char>, std::allocator<char> >, double)'
> /tmp/ccLFm4QL.o(.text+0x18e): undefined reference to
> `Employee::Employee[in-charge](std::basic_string<char,
> std::char_traits<char>, std::allocator<char> >, double)'
> collect2: ld returned 1 exit status
These are linker errors. Add a "-c" to your g++ line to just compile to a
.o file instead.
Pete
--
Gllug mailing list - Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug
More information about the GLLUG
mailing list