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]

Major problems with gcc/libstdc++ dealing with undefined references


Hi there! I have a problem. I wrecked my gcc compiler on my system
last week! I have no idea what to do. I have browsed thru some
mailing list archives but i wasn't able to find the solution. Probably
because I really don't know where/how to look for the solution in the
first place or/and i don't really know what i'm doing. Perhaps my
problem is rather simple. I hope so! ;)

I wrecked it because I wanted to solve a problem I had with libstdc++.
I wasn't able to compile a few apps like Mozilla and Texmacs with
gcc 2.95.2 and libstdc++ 2.90.8. I installed those more than a month
ago and i was able to compile my entire system (that is, every
utility, glibc, x11, gnome and some other stuff) without probem,
except from two applications I really would like to compile.

I tried my luck in USENET. I posted my original problem there, but i
got no solution. This was my 'original' first problem before I wrecked
gcc:

>   --- <<<<<<<<<<<<            Quote            >>>>>>>>>>>> ---
hi there! I hope this issue is relevant for this newsgroup. If not, my
apologies. I have some annoying compiling problems related to
libstdc++. I think the problems may be easy to solve, but I have no
idea how! If I want to compile certain applications like mozilla 0.9
and gnu-TeXmacs, the make command usually stops with these errors:

>------------------------------------------------------------------
/usr/lib/libstdc++.so: undefined reference to
`std::bad_alloc::~bad_alloc(void)'
/usr/lib/libstdc++.so: undefined reference to `std::exception
type_info function'
/usr/lib/libstdc++.so: undefined reference to `std::bad_cast type_info
node'
/usr/lib/libstdc++.so: undefined reference to `std::bad_cast virtual
table'
/usr/lib/libstdc++.so: undefined reference to `std::bad_alloc virtual
table'
/usr/lib/libstdc++.so: undefined reference to `std::exception
type_info node'
/usr/lib/libstdc++.so: undefined reference to `std::bad_cast type_info
function'
/usr/lib/libstdc++.so: undefined reference to
`std::exception::~exception(void)'
/usr/lib/libstdc++.so: undefined reference to
`std::bad_cast::bad_cast(void)'
/usr/lib/libstdc++.so: undefined reference to
`std::exception::exception(void)'
/usr/lib/libstdc++.so: undefined reference to
`std::bad_cast::~bad_cast(void)'
/usr/lib/libstdc++.so: undefined reference to `std::terminate(void)'
/usr/lib/libstdc++.so: undefined reference to
`std::uncaught_exception(void)'
/usr/lib/libstdc++.so: undefined reference to `std::exception virtual
table'
collect2: ld returned 1 exit status 
>------------------------------------------------------------------

I guess it may be a problem with some header files, perhaps? If so,
which ones? I really have no idea! I have set up my 'own' linux
totally from scratch; i compiled everything myself, including a
libstdc++ library (from the package libstdc++-2.90.8.tar.gz).
Still, I assume that the library is compiled correctly and (some?)
header files are correct also: after compiling and installation, i'm
able to compile & run certain "dependent" programs like 'ddd'
flawlessly, and I'm able to run dependent binaries such as netscape
4.73 too; all afterwards, thus things I couldn't do before the
installation of the library in question.

These library files who may be most relevant for this problem are
present on my system: (though i have installed 2.90.8, i'm wondering
why i have a libstdc++.so.3?)

{root}(0)[/usr/lib] # ls libstdc++*     
libstdc++-3-libc6.1-2-2.10.0.a   libstdc++-libc6.1-2.so.3 
libstdc++.so			 libstdc++-3-libc6.1-2-2.10.0.so 
libstdc++.a                      libstdc++.so.3
libstdc++-libc6.1-1.so.2         libstdc++.a.2.10.0       
libstdc++.so.3.0.0               libstdc++-libc6.1-2.a.3         
libstdc++.la

I have two directories in my /usr/include directory, ie.
/usr/include/g++ and /usr/include/g++-v3. The contents of these dirs
are totally different, though.

Anyone can give me a hint, a possible solution or a tip?? I hope so,
since i presume this problem may likely cause problems with other
packages as well. 

I got the errors with the following lines of makefile 'code':
------------------- texmacs -------------------
c++  -Wl,-Bdynamic -L/usr/src/TeXmacs-0.3.0-7-src/TeXmacs-0.3.0-7/lib
-lserver -lglue -ledit -ltypeset -lconvert -lwindow -lresource -lbasic
-L/usr/X11R6/lib -lXext -lX11 -L/usr/lib -lguile -lm -ldl
Objects/texmacs.o -o 

------------------- mozilla -------------------
`/mnt/storage/usr_src/mozilla-source-0.9/rdf/tests/rdfcat'
c++ -o rdfcat -I/usr/X11R6/include -fno-rtti -fno-exceptions -Wall
-Wconversion -Wpointer-arith -Wbad-function-cast -Wcast-align
-Woverloaded-virtual -Wsynth -pedantic -Wno-long-long -pipe -pthread
-DDEBUG -DDEBUG_root -DTRACING -g -DWIDGET_DLL=\"libwidget_gtk.so\"
-DGFXWIN_DLL=\"libgfx_gtk.so\" -I/usr/include/gtk-1.2
-I/usr/lib/glib/include -I/usr/X11R6/include  rdfcat.o
-L../../../dist/bin -L../../../dist/lib -lmozjs -L../../../dist/bin
-lxpcom -L/mnt/storage/usr_src/mozilla-source-0.9/dist/lib -lplds4
-lplc4 -lnspr4 -lpthread -ldl -lc  -L/usr/lib -L/usr/X11R6/lib -lgtk
-lgdk -rdynamic -lgmodule -lglib -ldl -lXext -lX11 -lm  -ldl -lm  -lc

FYI and if it's relevant: i'm using libstdc++-2.90.8.tar.gz, with
glibc-2.1.3, glibc-crypt-2.1, linuxthreads-2.1.3, and kernel 2.4.3. 

Thanks for your time and efforts in advance!. Cheers!
>   --- <<<<<<<<<<<<           /Quote            >>>>>>>>>>>> ---

Well, no-one had a solution. I tried to fiddle around myself. After
some reading and scratching my head now and then, I decided to
download the newest gcc (2.95.3) and the newest libstdc++. (2.92) i
could find past week; i copied the libstdc++ source into the gcc
source tree, moved the libstdc++ directory, renamed the libstdc++-2.92
dir to libstdc++, compiled it as usual and installed it...

..I ended up with a system which is unable to compile *any* cpp
program. all configure scripts dealing with packages consisting cpp
files now exit with the message "compiler can't create executables",
and if I compile a simple "one-line-c++ hello-world" program myself I
got these messages:

with gcc: (gcc bla.cpp) 
 - undefined reference to 'cout' 
 - undefined reference to 'ostream::operator<<(char const *);
 - collect2: ld returned 1 exit status

with g++ i got a more "familiar" one (g++ bla.cpp); i got the same
errors i had with my original problem:

 - /usr/lib/libstdc++.so: undefined reference to
  `std::bad_alloc::~bad_alloc(void)'
 - /usr/lib/libstdc++.so: undefined reference to `std::exception
  type_info function'
 - /usr/lib/libstdc++.so: undefined reference to `std::bad_cast
--- <<<<snip various errors>>>>
 - /usr/lib/libstdc++.so: undefined reference to `std::exception
   virtual table'
 - collect2: ld returned 1 exit status 

Well... I'm really stuck here. Now, i'm not even able to compile any
C++ package, and i really have no idea how to fix it.

Can anyone help me, or at least give me a hint, point me to the right
direction, and/or pointing me to a document on the web if this is a
question people asked before? (sorry if that's the case). Help will be
truly appreciated! I'm really stuck and i have the feeling this
mailing list is the only option i have left! 

Thanks for your help/assistance! 




btw: I hope I can receive all replies to this; my mail access is not
thrustworthy lately/recently.

Anyway.. cheers and thanks!

   /-- -   -    -   -  -\..
   \ #   # -- --  - --  /````
-- -  # # / Blablabla.... 
chromis# | E-mail at chromisx (at) home.nl
- --  # # \ Greetings from Holland!
   / #   # --  -  -\..
   \-- - - ----  --/````


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