public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Help, zillions of undefined references
@ 2004-03-04 20:15 Eric Evans
  2004-03-04 20:17 ` Ian Lance Taylor
       [not found] ` <5.2.1.1.2.20040304160333.00b778e8@postoffice9.mail.cornell .edu>
  0 siblings, 2 replies; 9+ messages in thread
From: Eric Evans @ 2004-03-04 20:15 UTC (permalink / raw)
  To: gcc-help

Hi everyone,

I have a problem with a make I'm trying to do that is resulting in lots and 
lots of undefined reference errors (see excerpt from error output at end of 
message).  The programmer who wrote the program has no idea why all the 
functions are not being linked in.  He says it ought to work, and he's 
basically washed his hands of the thing and tells me that it is up to me to 
deal with the problem.  In my web searching I came across a message from a 
guy who said that the __gxx_personality_v0 reference error could be fixed 
by using LD=$(CXX) in the Makefile, but I tried that and it didn't work.  I 
am using gcc 3.2.2 on RH linux version 9.  I'm using the default make 
program that comes with RH 9.  Is this a problem that could be fixed by 
switching to a different version of gcc or a different version of make?  Is 
there some linker option in the Makefile that I need to set in order to get 
this thing to work?  Unfortunately I have little knowledge of gcc and 
make.  Any advice I could get on how to proceed to troubleshoot this 
problem would be greatly appreciated.  Thanks very much.

Eric

> > main.o(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
> > xwindow.o(.text+0x12fa): In function `draw(_WidgetRec*, XButtonEvent*,
> > char**, int*)':
> > : undefined reference to `operator new(unsigned)'
> > xwindow.o(.text+0x1363): In function `draw(_WidgetRec*, XButtonEvent*,
> > char**, int*)':
> > : undefined reference to `operator delete(void*)'
> > xwindow.o(.text+0x136b): In function `draw(_WidgetRec*, XButtonEvent*,
> > char**, int*)':
> > : undefined reference to `_Unwind_Resume'
> > xwindow.o(.text+0x261e): In function `IMAGE_LIST::loadTsFile(_IO_FILE*)':
> > : undefined reference to `operator new(unsigned)'
> > xwindow.o(.text+0x2724): In function `IMAGE_LIST::loadTsFile(_IO_FILE*)':
> > : undefined reference to `operator new(unsigned)'
> > xwindow.o(.text+0x277a): In function `IMAGE_LIST::loadTsFile(_IO_FILE*)':
> > : undefined reference to `operator delete(void*)'
> > xwindow.o(.text+0x278f): In function `IMAGE_LIST::loadTsFile(_IO_FILE*)':
> > : undefined reference to `operator delete(void*)'
> > xwindow.o(.text+0x2797): In function `IMAGE_LIST::loadTsFile(_IO_FILE*)':
> > : undefined reference to `_Unwind_Resume'
> > xwindow.o(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'
> > make_pulldown.o(.text+0x4ce): In function `deformexit(_WidgetRec*)':
> > : undefined reference to `operator delete[](void*)'
> > make_pulldown.o(.text+0x4e3): In function `deformexit(_WidgetRec*)':
> > : undefined reference to `operator delete(void*)'

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Help, zillions of undefined references
  2004-03-04 20:15 Help, zillions of undefined references Eric Evans
@ 2004-03-04 20:17 ` Ian Lance Taylor
       [not found] ` <5.2.1.1.2.20040304160333.00b778e8@postoffice9.mail.cornell .edu>
  1 sibling, 0 replies; 9+ messages in thread
From: Ian Lance Taylor @ 2004-03-04 20:17 UTC (permalink / raw)
  To: Eric Evans; +Cc: gcc-help

Eric Evans <eje4@cornell.edu> writes:

> I have a problem with a make I'm trying to do that is resulting in
> lots and lots of undefined reference errors (see excerpt from error
> output at end of message).  The programmer who wrote the program has
> no idea why all the functions are not being linked in.  He says it
> ought to work, and he's basically washed his hands of the thing and
> tells me that it is up to me to deal with the problem.  In my web
> searching I came across a message from a guy who said that the
> __gxx_personality_v0 reference error could be fixed by using LD=$(CXX)
> in the Makefile, but I tried that and it didn't work.  I am using gcc
> 3.2.2 on RH linux version 9.  I'm using the default make program that
> comes with RH 9.  Is this a problem that could be fixed by switching
> to a different version of gcc or a different version of make?  Is
> there some linker option in the Makefile that I need to set in order
> to get this thing to work?  Unfortunately I have little knowledge of
> gcc and make.  Any advice I could get on how to proceed to
> troubleshoot this problem would be greatly appreciated.  Thanks very
> much.

Start by posting the exact command line which causes the error.

Ian

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Help, zillions of undefined references
       [not found] ` <5.2.1.1.2.20040304160333.00b778e8@postoffice9.mail.cornell .edu>
@ 2004-03-04 21:16   ` Eric Evans
  0 siblings, 0 replies; 9+ messages in thread
From: Eric Evans @ 2004-03-04 21:16 UTC (permalink / raw)
  To: gcc-help


> > I have a problem with a make I'm trying to do that is resulting in
> > lots and lots of undefined reference errors (see excerpt from error
> > output at end of message).  The programmer who wrote the program has
> > no idea why all the functions are not being linked in.  He says it
> > ought to work, and he's basically washed his hands of the thing and
> > tells me that it is up to me to deal with the problem.  In my web
> > searching I came across a message from a guy who said that the
> > __gxx_personality_v0 reference error could be fixed by using LD=$(CXX)
> > in the Makefile, but I tried that and it didn't work.  I am using gcc
> > 3.2.2 on RH linux version 9.  I'm using the default make program that
> > comes with RH 9.  Is this a problem that could be fixed by switching
> > to a different version of gcc or a different version of make?  Is
> > there some linker option in the Makefile that I need to set in order
> > to get this thing to work?  Unfortunately I have little knowledge of
> > gcc and make.  Any advice I could get on how to proceed to
> > troubleshoot this problem would be greatly appreciated.  Thanks very
> > much.
>
>Start by posting the exact command line which causes the error.

OK, here it is:
/usr/bin/g++296 -o tsnake -g       -L/usr/local/tsnake_new/lib -L/usr/X11R6/lib
  main.o xwindow.o make_pulldown.o  snaxel.o 
contour.o               tsnake.o dymprog.o io.o image.o lmesqCC.o 
fileDialogs.o InterestingArea.o              parameterDialogs.o 
minimization.o bSpline.o cutting.o   liblimin.a   -ltiff  -lm -lXm -lXt -lX11

If anybody has any ideas about how I should proceed to try to eliminate all 
these undefined references, I'd appreciate hearing them.  Thanks very much.

Eric  

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Help, zillions of undefined references
  2004-03-05 15:18     ` Eric Evans
@ 2004-03-05 15:44       ` Eljay Love-Jensen
  0 siblings, 0 replies; 9+ messages in thread
From: Eljay Love-Jensen @ 2004-03-05 15:44 UTC (permalink / raw)
  To: Eric Evans; +Cc: gcc-help

Hi Eric,

CC is typically the C compiler (e.g., gcc).

CXX is typically the C++ compiler (e.g., g++).

HTH,
--Eljay

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Help, zillions of undefined references
  2004-03-05 14:37   ` Ian Lance Taylor
@ 2004-03-05 15:18     ` Eric Evans
  2004-03-05 15:44       ` Eljay Love-Jensen
  0 siblings, 1 reply; 9+ messages in thread
From: Eric Evans @ 2004-03-05 15:18 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: lrtaylor, gcc-help

Hi Ian,

>I think the missing symbols you mentioned are mostly in libgcc.
>
>This suggests the possibility that you are building with one version
>of the compiler and linking with another.  You need to be consistent
>in this regard.  Are you building all of your code with gcc 2.96?
>Your code and also all statically linked libraries should be built
>with the same compiler.

Interesting.  I looked more closely at the Makefile and found that CC was 
set to g++296 and CXX was set to g++.  I have no idea what the purpose of 
CXX is in the Makefile but just for the hell of it I tried changing it to 
g++296 so it would match the compiler specified in CC.  And this fixed the 
problem!  Thanks very much for the helpful feedback.  Sorry to be such a 
whiner...

Eric
    

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: Help, zillions of undefined references
  2004-03-05 14:29 ` Eric Evans
  2004-03-05 14:37   ` Ian Lance Taylor
@ 2004-03-05 14:39   ` Eljay Love-Jensen
  1 sibling, 0 replies; 9+ messages in thread
From: Eljay Love-Jensen @ 2004-03-05 14:39 UTC (permalink / raw)
  To: Eric Evans, gcc-help

Hi Eric,

The C++ ABI between RedHat 2.96 and GCC 3.2 are not compatible.

Either compile everything with GCC 3.2, or compile everything with RedHat 2.96.

Since RedHat 2.96's C++ is pre-ISO 14882, I highly recommend GCC 3.2 (or 
3.3, or 3.4).

(This rule-of-thumb does not apply to C, since the C ABI is the same 
between both of compiler suites.)

--Eljay

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Help, zillions of undefined references
  2004-03-05 14:29 ` Eric Evans
@ 2004-03-05 14:37   ` Ian Lance Taylor
  2004-03-05 15:18     ` Eric Evans
  2004-03-05 14:39   ` Eljay Love-Jensen
  1 sibling, 1 reply; 9+ messages in thread
From: Ian Lance Taylor @ 2004-03-05 14:37 UTC (permalink / raw)
  To: Eric Evans; +Cc: lrtaylor, gcc-help

Eric Evans <eje4@cornell.edu> writes:

> The programmer told me that I should use gcc 2.96 in order to ensure
> that it links in the jpeg libraries that are needed by the program.
> But unfortunately, although using 2.96 does cause the jpeg libraries
> to be linked in properly, it also results in many dozens of other
> undefined reference errors.

I don't understand why the version of gcc would affect whether it
links in any jpeg libraries.  Which libraries are linked in would seem
to be purely an effect of how the link phase is invoked.

> Is there some way of finding out what specific library files these
> missing functions belong to?  I would think that these missing
> functions, since the programmer himself has no knowledge of them and
> is not explicitly invoking them in his program code, must be some
> common system functions that perform some kind of basic system
> operations and so they ought to well-known to somebody, somewhere out
> there!  If anyone has any thoughts on this problem, I would appreciate
> hearing them.  Thanks very much.

I think the missing symbols you mentioned are mostly in libgcc.

This suggests the possibility that you are building with one version
of the compiler and linking with another.  You need to be consistent
in this regard.  Are you building all of your code with gcc 2.96?
Your code and also all statically linked libraries should be built
with the same compiler.

Ian

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: Help, zillions of undefined references
       [not found] <363801FFD7B74240A329CEC3F7FE4CC4015F3A1C@ntxboimbx07.micro n.com>
@ 2004-03-05 14:29 ` Eric Evans
  2004-03-05 14:37   ` Ian Lance Taylor
  2004-03-05 14:39   ` Eljay Love-Jensen
  0 siblings, 2 replies; 9+ messages in thread
From: Eric Evans @ 2004-03-05 14:29 UTC (permalink / raw)
  To: lrtaylor, gcc-help

Hi Lyle et al,

Thanks so much for your message and your suggestion. I tried as you 
suggested and unfortunately I still get a lot of undefined reference 
errors, although different ones than the ones I get when I'm using gcc 2.96.

The programmer told me that I should use gcc 2.96 in order to ensure that 
it links in the jpeg libraries that are needed by the program.  But 
unfortunately, although using 2.96 does cause the jpeg libraries to be 
linked in properly, it also results in many dozens of other undefined 
reference errors.

Is there some way of finding out what specific library files these missing 
functions belong to?  I would think that these missing functions, since the 
programmer himself has no knowledge of them and is not explicitly invoking 
them in his program code, must be some common system functions that perform 
some kind of basic system operations and so they ought to well-known to 
somebody, somewhere out there!  If anyone has any thoughts on this problem, 
I would appreciate hearing them.  Thanks very much.

Eric

>It looks like you're actually using GCC 2.96 (since your command is
>g++296).  Try changing CC and CXX in your Makefile to be gcc and g++,
>respectively.  That should get you using the right compiler that came
>with the system.  You're probably actually just using a version of GCC
>added to the system for backward compatibility.
>
>Cheers,
>Lyle
>
>-----Original Message-----
>From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On
>Behalf Of Eric Evans
>Sent: Thursday, March 04, 2004 2:18 PM
>To: gcc-help@gcc.gnu.org
>Subject: Re: Help, zillions of undefined references
>
>
> > > I have a problem with a make I'm trying to do that is resulting in
> > > lots and lots of undefined reference errors (see excerpt from error
> > > output at end of message).  The programmer who wrote the program has
> > > no idea why all the functions are not being linked in.  He says it
> > > ought to work, and he's basically washed his hands of the thing and
> > > tells me that it is up to me to deal with the problem.  In my web
> > > searching I came across a message from a guy who said that the
> > > __gxx_personality_v0 reference error could be fixed by using
>LD=$(CXX)
> > > in the Makefile, but I tried that and it didn't work.  I am using
>gcc
> > > 3.2.2 on RH linux version 9.  I'm using the default make program
>that
> > > comes with RH 9.  Is this a problem that could be fixed by switching
> > > to a different version of gcc or a different version of make?  Is
> > > there some linker option in the Makefile that I need to set in order
> > > to get this thing to work?  Unfortunately I have little knowledge of
> > > gcc and make.  Any advice I could get on how to proceed to
> > > troubleshoot this problem would be greatly appreciated.  Thanks very
> > > much.
> >
> >Start by posting the exact command line which causes the error.
>
>OK, here it is:
>/usr/bin/g++296 -o tsnake -g       -L/usr/local/tsnake_new/lib
>-L/usr/X11R6/lib
>   main.o xwindow.o make_pulldown.o  snaxel.o
>contour.o               tsnake.o dymprog.o io.o image.o lmesqCC.o
>fileDialogs.o InterestingArea.o              parameterDialogs.o
>minimization.o bSpline.o cutting.o   liblimin.a   -ltiff  -lm -lXm -lXt
>-lX11
>
>If anybody has any ideas about how I should proceed to try to eliminate
>all
>these undefined references, I'd appreciate hearing them.  Thanks very
>much.
>
>Eric

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: Help, zillions of undefined references
@ 2004-03-04 21:34 lrtaylor
  0 siblings, 0 replies; 9+ messages in thread
From: lrtaylor @ 2004-03-04 21:34 UTC (permalink / raw)
  To: eje4, gcc-help

It looks like you're actually using GCC 2.96 (since your command is
g++296).  Try changing CC and CXX in your Makefile to be gcc and g++,
respectively.  That should get you using the right compiler that came
with the system.  You're probably actually just using a version of GCC
added to the system for backward compatibility.

Cheers,
Lyle

-----Original Message-----
From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On
Behalf Of Eric Evans
Sent: Thursday, March 04, 2004 2:18 PM
To: gcc-help@gcc.gnu.org
Subject: Re: Help, zillions of undefined references


> > I have a problem with a make I'm trying to do that is resulting in
> > lots and lots of undefined reference errors (see excerpt from error
> > output at end of message).  The programmer who wrote the program has
> > no idea why all the functions are not being linked in.  He says it
> > ought to work, and he's basically washed his hands of the thing and
> > tells me that it is up to me to deal with the problem.  In my web
> > searching I came across a message from a guy who said that the
> > __gxx_personality_v0 reference error could be fixed by using
LD=$(CXX)
> > in the Makefile, but I tried that and it didn't work.  I am using
gcc
> > 3.2.2 on RH linux version 9.  I'm using the default make program
that
> > comes with RH 9.  Is this a problem that could be fixed by switching
> > to a different version of gcc or a different version of make?  Is
> > there some linker option in the Makefile that I need to set in order
> > to get this thing to work?  Unfortunately I have little knowledge of
> > gcc and make.  Any advice I could get on how to proceed to
> > troubleshoot this problem would be greatly appreciated.  Thanks very
> > much.
>
>Start by posting the exact command line which causes the error.

OK, here it is:
/usr/bin/g++296 -o tsnake -g       -L/usr/local/tsnake_new/lib
-L/usr/X11R6/lib
  main.o xwindow.o make_pulldown.o  snaxel.o 
contour.o               tsnake.o dymprog.o io.o image.o lmesqCC.o 
fileDialogs.o InterestingArea.o              parameterDialogs.o 
minimization.o bSpline.o cutting.o   liblimin.a   -ltiff  -lm -lXm -lXt
-lX11

If anybody has any ideas about how I should proceed to try to eliminate
all 
these undefined references, I'd appreciate hearing them.  Thanks very
much.

Eric  

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2004-03-05 15:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-04 20:15 Help, zillions of undefined references Eric Evans
2004-03-04 20:17 ` Ian Lance Taylor
     [not found] ` <5.2.1.1.2.20040304160333.00b778e8@postoffice9.mail.cornell .edu>
2004-03-04 21:16   ` Eric Evans
2004-03-04 21:34 lrtaylor
     [not found] <363801FFD7B74240A329CEC3F7FE4CC4015F3A1C@ntxboimbx07.micro n.com>
2004-03-05 14:29 ` Eric Evans
2004-03-05 14:37   ` Ian Lance Taylor
2004-03-05 15:18     ` Eric Evans
2004-03-05 15:44       ` Eljay Love-Jensen
2004-03-05 14:39   ` Eljay Love-Jensen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).