libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tests/tagdemo: ISO C++


From: Albert Chin
Subject: Re: tests/tagdemo: ISO C++
Date: Mon, 4 Oct 2004 21:02:56 -0500
User-agent: Mutt/1.5.6i

On Mon, Oct 04, 2004 at 05:06:32PM +0100, Gary V. Vaughan wrote:
> Bob Friesenhahn wrote:
> > On Sun, 3 Oct 2004, Ralf Wildenhues wrote:
> > 
> >> This patch brings the tagdemo up to ISO C++.  I do not know how
> >> well compilers support this, but eventually something like this
> >> should be applied.
> >>
> >> So whoever has a compiler that does not understand this, speak
> >> up ;)
> 
> None of the solaris compilers I'm testing understand it.  However, neither
> are they any worse off.  I get this error from make in tests/tagdemo with
> or without the patch applied:
> 
> CC -G -zdefs -nolib -hlibfoo.so.0 -o .libs/libfoo.so.0.0.0   .libs/foo.o
> -Qoption ld -z -Qoption ld allextract,./.libs/libconv.a -Qoption ld -z
> -Qoption ld defaultextract  -lm
> Undefined                       first referenced
>  symbol                             in file
> std::cout                      .libs/foo.o
> [Hint: static member std::cout must be defined in the program]
> 
> std::ostream &std::ostream::put(char) .libs/foo.o
> std::ostream &std::ostream::operator<<(std::ostream &(*)(std::ostream &))
> .libs/foo.o
> std::ostream &std::operator<<(std::ostream &,const char*) .libs/foo.o
> std::ostream &std::ostream::operator<<(double) .libs/foo.o
> std::ostream &std::ostream::flush() .libs/foo.o
> ld: fatal: Symbol referencing errors. No output written to
> .libs/libfoo.so.0.0.0*** Error code 1
> make: Fatal error: Command failed for target `libfoo.la'
> 
> I can get it to compile by removing -zdefs, but that simply allows undefined
> symbols in libfoo, which isn't what we want.  Not sure what to do about this
> one...

This problem has been mentioned before, without any resolution. The
problem is that the C++ functions needed to resolve the undefined
symbols are in -lCrun. This library should be added during
_LT_SYS_HIDDEN_LIBDEPS but _LT_SYS_HIDDEN_LIBDEPS is broken wrt
non-GCC compilers.

The old thread about this is here:
  http://lists.gnu.org/archive/html/libtool/2003-06/msg00001.html

> HP-UX's aCC passes tagdemo tests without the patch, but with the patch applied
> gives:
> 
>  aCC -DPACKAGE_NAME=\"tagdemo\" -DPACKAGE_TARNAME=\"tagdemo\"
> -DPACKAGE_VERSION=\"1.0\" "-DPACKAGE_STRING=\"tagdemo 1.0\""
> -DPACKAGE_BUGREPORT=\"address@hidden" -DPACKAGE=\"tagdemo\"
> -DVERSION=\"1.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1
> -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1
> -DHAVE_INTTYPES_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\"
> -DHAVE_MATH_H=1 -I. -I/home/gary/libtool/libtool-1.9e/tests/tagdemo
> -I/home/gary/libtool/libtool-1.9e/tests/tagdemo/../.. -g -c
> /home/gary/libtool/libtool-1.9e/tests/tagdemo/foo.cpp  +Z -DPIC -o .libs/foo.o
> Error 112: "/home/gary/libtool/libtool-1.9e/tests/tagdemo/foo.cpp", line 23 #
>     Include file <iostream> not found.
>     #include <iostream>
>              ^^^^^^^^^^
> Error 697: "/home/gary/libtool/libtool-1.9e/tests/tagdemo/foo.cpp", line 29 #
>     Only namespace names are valid here.
>     using namespace std;
>                     ^^^
> Error 172: "/home/gary/libtool/libtool-1.9e/tests/tagdemo/foo.cpp", line 35 #
>     Undeclared variable 'cout'.
>       cout << "cos (0.0) = " << (double) cos ((double) 0.0) << endl;
>       ^^^^
> Error 172: "/home/gary/libtool/libtool-1.9e/tests/tagdemo/foo.cpp", line 42 #
>     Undeclared variable 'cout'.
>       cout << "** This is libfoo (tagdemo) **" << endl;
>       ^^^^
> gmake: *** [foo.lo] Error 1

You need CXXFLAGS="-AA".

-- 
albert chin (address@hidden)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]