public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* __pure_virtual undefined symbol : SOLVED
@ 2001-08-01  2:15 sujit kumar
  0 siblings, 0 replies; 6+ messages in thread
From: sujit kumar @ 2001-08-01  2:15 UTC (permalink / raw)
  To: gcc-help

Hi All

I would like u to see a particular Linker error that I
was facing while linking the files.
"
/source/GLOOF/ga/Video/framewrk/opengl/material.o(.gnu.linkonce.d.__vt_Q22gl8Material+0x8):
undefined reference to `__pure_virtual' " 
and same error was coming for various files.

These were the flags for linking : 
ld -m elf_i386 -dynamic-linker /lib/ld-linux.so.2
/usr/lib/crt1.o /usr/lib/crti.o
/usr/lib/gcc-lib/i386-linux/egcs-2.91.66/crtbegin.o
-L/usr/lib/gcc-lib/i386-linux/egcs-2.91.66
-L/usr/i386-linux/lib -lstdc++ -lm -lgcc -lc -lgcc
/usr/lib/gcc-lib/i386-linux/egcs-2.91.66/crtend.o
/usr/lib/crtn.o -lglut -ffast-math -lMesaGL -lm
-L/usr/X11/lib -L/usr/X11R6/lib -lX11 -lX11 -lXext
-lXmu -lXi -lSM -lICE

The SOLUTION:
The libgcc is not being included properly and this was
sorted out by extracting _pure.o from libgcc.a using
"nm" and linking it along with other object files.

Regards
Sujit Kumar.



__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

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

* Re: __pure_virtual undefined symbol : SOLVED
  2001-08-02 10:59     ` aoliva
@ 2001-08-17  4:52       ` sujit kumar
  0 siblings, 0 replies; 6+ messages in thread
From: sujit kumar @ 2001-08-17  4:52 UTC (permalink / raw)
  To: aoliva; +Cc: gcc-help

hi Alexandre,

How r u ?
I am facing a problem ie., the final executable that I
make using the same script does not call the main
function instead it calls some specific constructors.

I tried debugging the final executable but 

(gdb) r
Starting program: /source/GLOOF/ga/./ALADDIN

Breakpoint 1, 0x809bf74 in gl::Renderer::Renderer ()
(gdb) bt
#0  0x809bf74 in gl::Renderer::Renderer ()
#1  0x809bf5c in gl::Renderer::getInstance ()
#2  0x808c082 in gl::Camera::Camera ()
#3  0x8082274 in global constructors keyed to
ToggleFold ()
#4  0x804d336 in __do_global_ctors_aux ()
#5  0x804c2be in _init ()
#6  0x2ab3e6fe in __libc_start_main ()
(gdb)

Is there any lines on which U can suggest as to why
the startup code is not calling main.cpp.
Pls suggest.

Thanx &
Regards
Sujit
 

--- aoliva@redhat.com wrote:
> On Aug  2, 2001, sujit kumar <kumar_sujit@yahoo.com>
> wrote:
> 
> > The solution that U have suggested is not working
> as well.
> 
> Did you try to use gcc for linking, instead of
> running ld directly?
> 
> -- 
> Alexandre Oliva   Enjoy Guarana', see
> http://www.ic.unicamp.br/~oliva/
> Red Hat GCC Developer                 
> aoliva@{cygnus.com, redhat.com}
> CS PhD student at IC-Unicamp       
> oliva@{lsd.ic.unicamp.br, gnu.org}
> Free Software Evangelist    *Please* write to
> mailing lists, not to me


__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

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

* Re: __pure_virtual undefined symbol : SOLVED
  2001-08-02  0:43   ` sujit kumar
@ 2001-08-02 10:59     ` aoliva
  2001-08-17  4:52       ` sujit kumar
  0 siblings, 1 reply; 6+ messages in thread
From: aoliva @ 2001-08-02 10:59 UTC (permalink / raw)
  To: sujit kumar; +Cc: gcc-help

On Aug  2, 2001, sujit kumar <kumar_sujit@yahoo.com> wrote:

> The solution that U have suggested is not working as well.

Did you try to use gcc for linking, instead of running ld directly?

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me

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

* Re: __pure_virtual undefined symbol : SOLVED
  2001-08-01  5:36 ` Alexandre Oliva
@ 2001-08-02  0:43   ` sujit kumar
  2001-08-02 10:59     ` aoliva
  0 siblings, 1 reply; 6+ messages in thread
From: sujit kumar @ 2001-08-02  0:43 UTC (permalink / raw)
  To: Alexandre Oliva; +Cc: gcc-help

Hi Alexandre 

Thanks for the prompt reply. I had tried to see many
mailing lists and i could not find a satisfacory
solution.
The solution that U have suggested is not working as
well.
If I extract _pure.o from libgcc.a and link it along
with other object files , I am not getting these error
messages.
Why is that ? Can u throw some light on the mechanism
?

Thanks &
Regards
Sujit Kumar
 


--- Alexandre Oliva <aoliva@redhat.com> wrote:
> On Aug  1, 2001, sujit kumar <kumar_sujit@yahoo.com>
> wrote:
> 
> 
> > These are the flags for linking : 
> > ld -m elf_i386 -dynamic-linker /lib/ld-linux.so.2
> > /usr/lib/crt1.o /usr/lib/crti.o
> >
> /usr/lib/gcc-lib/i386-linux/egcs-2.91.66/crtbegin.o
> > -L/usr/lib/gcc-lib/i386-linux/egcs-2.91.66
> > -L/usr/i386-linux/lib -lstdc++ -lm -lgcc -lc -lgcc
> > /usr/lib/gcc-lib/i386-linux/egcs-2.91.66/crtend.o
> > /usr/lib/crtn.o -lglut -ffast-math -lMesaGL -lm
> > -L/usr/X11/lib -L/usr/X11R6/lib -lX11 -lX11 -lXext
> > -lXmu -lXi -lSM -lICE
> 
> This looks definitely wrong.  `-lstdc++ -lm -lgcc
> -lc -lgcc' should
> appear after all other libraries.  This explains why
> linking failed.
> The order of arguments to the linker is significant.
> 
> -- 
> Alexandre Oliva   Enjoy Guarana', see
> http://www.ic.unicamp.br/~oliva/
> Red Hat GCC Developer                 
> aoliva@{cygnus.com, redhat.com}
> CS PhD student at IC-Unicamp       
> oliva@{lsd.ic.unicamp.br, gnu.org}
> Free Software Evangelist    *Please* write to
> mailing lists, not to me


__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

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

* Re: __pure_virtual undefined symbol : SOLVED
  2001-08-01  2:14 sujit kumar
@ 2001-08-01  5:36 ` Alexandre Oliva
  2001-08-02  0:43   ` sujit kumar
  0 siblings, 1 reply; 6+ messages in thread
From: Alexandre Oliva @ 2001-08-01  5:36 UTC (permalink / raw)
  To: sujit kumar; +Cc: gcc-help

On Aug  1, 2001, sujit kumar <kumar_sujit@yahoo.com> wrote:


> These are the flags for linking : 
> ld -m elf_i386 -dynamic-linker /lib/ld-linux.so.2
> /usr/lib/crt1.o /usr/lib/crti.o
> /usr/lib/gcc-lib/i386-linux/egcs-2.91.66/crtbegin.o
> -L/usr/lib/gcc-lib/i386-linux/egcs-2.91.66
> -L/usr/i386-linux/lib -lstdc++ -lm -lgcc -lc -lgcc
> /usr/lib/gcc-lib/i386-linux/egcs-2.91.66/crtend.o
> /usr/lib/crtn.o -lglut -ffast-math -lMesaGL -lm
> -L/usr/X11/lib -L/usr/X11R6/lib -lX11 -lX11 -lXext
> -lXmu -lXi -lSM -lICE

This looks definitely wrong.  `-lstdc++ -lm -lgcc -lc -lgcc' should
appear after all other libraries.  This explains why linking failed.
The order of arguments to the linker is significant.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me

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

* __pure_virtual undefined symbol : SOLVED
@ 2001-08-01  2:14 sujit kumar
  2001-08-01  5:36 ` Alexandre Oliva
  0 siblings, 1 reply; 6+ messages in thread
From: sujit kumar @ 2001-08-01  2:14 UTC (permalink / raw)
  To: gcc-help

Hi All

I would like you to suggest on a particular Linker
error that I was facing while linking the files.
"
/source/GLOOF/ga/Video/framewrk/opengl/material.o(.gnu.linkonce.d.__vt_Q22gl8Material+0x8):
undefined reference to `__pure_virtual' " 
and same error is coming for various files.

These are the flags for linking : 
ld -m elf_i386 -dynamic-linker /lib/ld-linux.so.2
/usr/lib/crt1.o /usr/lib/crti.o
/usr/lib/gcc-lib/i386-linux/egcs-2.91.66/crtbegin.o
-L/usr/lib/gcc-lib/i386-linux/egcs-2.91.66
-L/usr/i386-linux/lib -lstdc++ -lm -lgcc -lc -lgcc
/usr/lib/gcc-lib/i386-linux/egcs-2.91.66/crtend.o
/usr/lib/crtn.o -lglut -ffast-math -lMesaGL -lm
-L/usr/X11/lib -L/usr/X11R6/lib -lX11 -lX11 -lXext
-lXmu -lXi -lSM -lICE

The SOLUTION:
The libgcc is not being included properly and this was
sorted out by extracting _pure.o from libgcc.a using
"nm" and linking it along with other object files.

Regards
Sujit Kumar.



__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

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

end of thread, other threads:[~2001-08-17  4:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-01  2:15 __pure_virtual undefined symbol : SOLVED sujit kumar
  -- strict thread matches above, loose matches on Subject: below --
2001-08-01  2:14 sujit kumar
2001-08-01  5:36 ` Alexandre Oliva
2001-08-02  0:43   ` sujit kumar
2001-08-02 10:59     ` aoliva
2001-08-17  4:52       ` sujit kumar

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).