inline linking problem

eddy en@mpifr-bonn.mpg.de
Tue Feb 15 23:30:00 GMT 2000


Bug report      16. February 2000       by eddy

There is 'bug.tar' attached and includes the files
        makefile  vector.h  vector.cc  bug.cc

(egcs-2.91.66, Intel-Pentium-II)

If you type 'make' the following problem occurs:

>  g++ -c bug.cc -Wall
>  g++ -c vector.cc -Wall
>  g++ -o bug -lg++ -Wall bug.o vector.o
>  bug.o: In function Main':
>  bug.o(.text+0x31): undefined reference to Vector::z(void) const'
>  bug.o(.text+0x45): undefined reference to Vector::y(void) const'
>  bug.o(.text+0x59): undefined reference to Vector::x(void) const'
>  collect2: ld returned 1 exit status
>  make[1]: *** [bug] Error 1
   
but if you uncomment the unused method vector::product() in vector.cc 
then everything is fine.

There must be anything about the 'inline' statements that confuses
the linker in some case of optimisation. 


Eddy Nussbaum
Max-Planck-Institut fuer Radioastronomie
53121 Bonn, Germany
en@mpifr-bonn.mpg.de

--
bug.tar

-------------- next part --------------
A non-text attachment was scrubbed...
Name: bug.tar
Type: application/x-tar
Size: 10240 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/20000215/4cd7a9e0/attachment.tar>


More information about the Gcc-bugs mailing list