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]
Other format: [Raw text]

RE: Undefined symbol error when linking with g++.


If window_lib.a is a C++ library that was compiled with the old
compiler, then you will have to rebuild it with the new compiler in
order to use it with the new compiler.  C++ code built with the old
compiler is not compatible with C++ code built with the new compiler.
Basically, you will have to rebuild all C++ libraries that you're using
with the new compiler.

Cheers,
Lyle


-----Original Message-----
From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On
Behalf Of Kenneth R Leach
Sent: Friday, March 12, 2004 11:00 AM
To: gcc-help@gcc.gnu.org
Subject: Undefined symbol error when linking with g++.

We recently upgraded our GNU GCC compiler from 2.95.2 to 3.2.3. When
attempting to compile one of our system libraries, the following error
is
reported.

Undefined symbol _XmStrings21 first reference in file
window_lib.a(color_util.o)
ld: fatal: Symbol referencing errors. No output written to demo
collect2: ld returned 1 exit status

However, this library builds fine with our 2.95.2 version.

The differences are that the 2.95.2 compiler was prebuilt for our OS and
the 3.2.3, we built. Plus the binutils are part of the 2.95.2 version,
where as we built ours and installed them in a separate directory.

In the makefile, the linker is called by the $(LINK) macro, which is
evaluating to g++. I performed a test and found that if I replace the
$(LINK) macro with "ld", which is the binutils "ld", the library
compiles.

Any ideas why the new GCC is having a problem, where the old one did
not?

Any assistance would be greatly appreciated.

Thanks.


------------------------------------------------------------------------
----------------

This is a PRIVATE message. If you are not the intended recipient, please
delete without copying and kindly advise us by e-mail of the mistake in
delivery. NOTE: Regardless of content, this e-mail shall not operate to
bind CSC to any order or other contract unless pursuant to explicit
written
agreement or government initiative expressly permitting the use of
e-mail
for such purpose.
------------------------------------------------------------------------
----------------




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