This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: problem with iostream


> > hello, i have just upgraded to the latest version of redhat linux
> > and suddenly my g++ compiled programs fall over.
 
> From your description, it was not clear whether the old binaries
> stopped working on the new system, or whether binaries created on the
> new system with the new compiler would break.
 
thank you for your help. old binaries still work. Only newly compiled ones
coredump.
 
> Also, it is not clear to me whether you have installed the latest
> redhat version "from scratch", or overwritten your previous
> installation. It may well be that there were still some old files
> lying around which should have been removed but weren't.
 
i have overwritten my previous (2 year old) installation.  i suspect
that your analysis is correct. alas i am not familiar enough with the
g++ library system to work out which files are the troublemakers.
(btw: is there an easily accessible description of the structure
of g++ and its libraries, or do i have to read the code/man pages to
get the picture?)
 
> To investigate this further, please try the following commands:
 
> ldd <your compiled program>
> g++ -o <output file> <your source file> -v --trace-includes
 
> rpm -qf <library name>
 

the output is quoted below.
 
thanks, martin
 
i am using redhat release 6.1, kernel 2.2.12.20. the output of ldd is:
 
--------------------------------------------------------------------------
 
  libm.so.6 => /lib/libm.so.6 (0x40018000)
  libc.so.6 => /lib/libc.so.6 (0x40035000)
  /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
 
--------------------------------------------------------------------------
 
  lsl /lib/libm.so.6
  lrwxrwxrwx   1 root     root           13 Mar 21 23:46 /lib/libm.so.6 -> libm-2.1.2.so
  lsl /lib/libc.so.6
  lrwxrwxrwx   1 root     root           13 Mar 21 23:46 /lib/libc.so.6 -> libc-2.1.2.so
  lsl /lib/ld-linux.so.2
  lrwxrwxrwx   1 root     root           11 Mar 21 23:46 /lib/ld-linux.so.2 -> ld-2.1.2.so
 
  /lib> rpm -qf libm-2.1.2.so
  glibc-2.1.2-11
  /lib> rpm -qf libc-2.1.2.so
  glibc-2.1.2-11
  /lib> rpm -qf ld-2.1.2.so 
  glibc-2.1.2-11
 
the output of g++ with the aforementioned command line options is as
follows.
--------------------------------------------------------------------------
 
  Reading specs from /usr/local/lib/gcc-lib/i586-pc-linux-gnu/egcs-2.91.66/specs
  gcc version egcs-2.91.66 19990314 (egcs-1.1.2 release)
  /usr/local/lib/gcc-lib/i586-pc-linux-gnu/egcs-2.91.66/cpp -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -D__GNUC_MINOR__=91 -D__ELF__ -Dunix -Di386 -D__i386__ -Dlinux -D__ELF__ -D__unix__ -D__i386__ -D__i386__ -D__linux__ -D__unix -D__i386 -D__linux -Asystem(posix) -D__EXCEPTIONS -H -Asystem(unix) -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__ -Di586 -Dpentium -D__i586 -D__i586__ -D__pentium -D__pentium__ test.cpp /tmp/ccBN0ncc.ii
  GNU CPP version egcs-2.91.66 19990314 (egcs-1.1.2 release) (i386 Linux/ELF)
  #include "..." search starts here:
  #include <...> search starts here:
   /usr/local/include/g++
   /usr/local/include
   /usr/local/i586-pc-linux-gnu/include
   /usr/local/lib/gcc-lib/i586-pc-linux-gnu/egcs-2.91.66/include
   /usr/include
  End of search list.
  /usr/local/include/g++/iostream
   /usr/local/include/g++/iostream.h
    /usr/local/include/g++/streambuf.h
     /usr/include/libio.h
      /usr/include/_G_config.h
       /usr/include/bits/types.h
        /usr/include/features.h
         /usr/include/sys/cdefs.h
         /usr/include/gnu/stubs.h
        /usr/local/lib/gcc-lib/i586-pc-linux-gnu/egcs-2.91.66/include/stddef.h
       /usr/local/lib/gcc-lib/i586-pc-linux-gnu/egcs-2.91.66/include/stddef.h
      /usr/local/lib/gcc-lib/i586-pc-linux-gnu/egcs-2.91.66/include/stdarg.h
     /usr/local/lib/gcc-lib/i586-pc-linux-gnu/egcs-2.91.66/include/stdarg.h
   /usr/local/lib/gcc-lib/i586-pc-linux-gnu/egcs-2.91.66/cc1plus /tmp/ccBN0ncc.ii -quiet -dumpbase test.cc -version -o /tmp/ccIKwR7h.s
  GNU C++ version egcs-2.91.66 19990314 (egcs-1.1.2 release) (i586-pc-linux-gnu) compiled by GNU C version egcs-2.91.66 19990314 (egcs-1.1.2 release).
   as -V -Qy -o /tmp/ccVMJY2e.o /tmp/ccIKwR7h.s
  GNU assembler version 2.9.1 (i386-redhat-linux), using BFD version 2.9.1.0.24
   /usr/local/lib/gcc-lib/i586-pc-linux-gnu/egcs-2.91.66/collect2 -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -o a.out /usr/lib/crt1.o /usr/lib/crti.o /usr/local/lib/gcc-lib/i586-pc-linux-gnu/egcs-2.91.66/crtbegin.o -L/usr/local/lib/gcc-lib/i586-pc-linux-gnu/egcs-2.91.66 -L/usr/local/i586-pc-linux-gnu/lib -L/usr/local/lib /tmp/ccVMJY2e.o -lstdc++ -lm -lgcc -lc -lgcc /usr/local/lib/gcc-lib/i586-pc-linux-gnu/egcs-2.91.66/crtend.o /usr/lib/crtn.o
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]