GUI compile problems (fwd)

Hi folks, Sam said I should bug you regarding problems compiling the
GUI example. I’ve installed SDL 0.9.9.

I’m running Linux 2.0.36 on a P133. Thanks! :slight_smile:

-bill!

----- Forwarded message from Sam Lantinga -----

From slouken at devolution.com Thu Mar 25 21:10:27 1999
Delivered-To: @Bill_KendrickTo: William Kendrick <@Bill_Kendrick>
Subject: Re: GUI compile problems
X-Mailer: My Mailer 1.5
Message-Id:
From: slouken@libsdl.org (slouken)
Date: Thu, 25 Mar 1999 13:10:43 -0800

You might ask the SDL mailing list. I remember people having the problem
and fixing it, but I don’t remember the solution.

cc -o hello hello.o -L. -lGUI -lpthread -L/usr/local/lib -Wl,-rpath,/usr/local/lib -lSDL -ldl
hello.o: In function main': hello.o(.text+0x3b4): undefined reference to__eh_pc’
hello.o(.text+0x3bd): undefined reference to __throw' hello.o(.text+0x3cc): undefined reference to__eh_pc’
hello.o(.text+0x3d5): undefined reference to __throw' hello.o(.text+0x3e4): undefined reference to__eh_pc’
hello.o(.text+0x3ed): undefined reference to __throw' hello.o(.text+0x3fc): undefined reference to__eh_pc’
hello.o(.text+0x405): undefined reference to __throw' hello.o(.text+0x414): undefined reference to__eh_pc’
hello.o(.text+0x41d): undefined reference to __throw' hello.o(.text+0x425): undefined reference toterminate(void)’

-Sam Lantinga				(slouken at devolution.com)

Lead Programmer, Loki Entertainment Software

Author of Simple DirectMedia Layer -
http://www.devolution.com/~slouken/SDL/

----- End of forwarded message from Sam Lantinga -----

William Kendrick wrote:

cc -o hello hello.o -L. -lGUI -lpthread -L/usr/local/lib -Wl,-rpath,/usr/local/lib -lSDL -ldl
hello.o: In function main': hello.o(.text+0x3b4): undefined reference to__eh_pc’
hello.o(.text+0x3bd): undefined reference to `__throw’

It looks like part of this was compiled with egcs, but you’re using an older
gcc. Are you using pre-compiled SDL libs?

m.–
“We can deny everything, except that we have the possibility of being better.
Simply reflect on that.”
– His Holiness The Dalai Lama

William Kendrick wrote:

cc -o hello hello.o -L. -lGUI -lpthread -L/usr/local/lib -Wl,-rpath,/usr/local/lib -lSDL -ldl
hello.o: In function main': hello.o(.text+0x3b4): undefined reference to__eh_pc’
hello.o(.text+0x3bd): undefined reference to `__throw’

It looks like part of this was compiled with egcs, but you’re using an older
gcc. Are you using pre-compiled SDL libs?

Nope! I just built 0.9.9 from scratch. I double-checked to see if any of
/usr/local/lib/libSDL* are old, but it’s all from this morning… <:^/

-bill!

I already had this problem but I forgot how I had resolved it
but now you know it CAN be resolved.
Have you checked the GNUmake file ?
Have you inserted it ?
Is /usr/local/lib in your ldpath ?
if not, try a ldconfig with some option I don’t remember,

Good luck

Stephane

-----Message d’origine-----De : William Kendrick
? : sdl at surfnetcity.com.au
Date : vendredi, 26. mars 1999 00:57
Objet : Re: [SDL] Re: GUI compile problems (fwd)

William Kendrick wrote:

cc -o hello
hello.o -L. -lGUI -lpthread -L/usr/local/lib -Wl,-rpath,/usr/local/lib -lSDL
-ldl

hello.o: In function main': hello.o(.text+0x3b4): undefined reference to__eh_pc’
hello.o(.text+0x3bd): undefined reference to `__throw’

It looks like part of this was compiled with egcs, but you’re using an
older

gcc. Are you using pre-compiled SDL libs?

Nope! I just built 0.9.9 from scratch. I double-checked to see if any of
/usr/local/lib/libSDL* are old, but it’s all from this morning… <:^/

-bill!

I had this happen to me a couple of times too … I don’t remember what I did
about it either, BUT I seem to recall that it came down to something about the
linker not mixing C and C++ objs and libs. I remember that in debugging it if
I turned all of my C sources into CPP sources (which sucked!) the problem went
away. YMMV.

/devOn 26-Mar-99 St?phane Magnenat wrote:

I already had this problem but I forgot how I had resolved it
but now you know it CAN be resolved.
Have you checked the GNUmake file ?
Have you inserted it ?
Is /usr/local/lib in your ldpath ?
if not, try a ldconfig with some option I don’t remember,

cc -o hello
hello.o -L. -lGUI -lpthread -L/usr/local/lib -Wl,-rpath,/usr/local/lib -lSDL
-ldl

hello.o: In function main': hello.o(.text+0x3b4): undefined reference to__eh_pc’
hello.o(.text+0x3bd): undefined reference to `__throw’

It looks like part of this was compiled with egcs, but you’re using an
older

gcc. Are you using pre-compiled SDL libs?

Nope! I just built 0.9.9 from scratch. I double-checked to see if any of
/usr/local/lib/libSDL* are old, but it’s all from this morning… <:^/


// David E. Vandewalle |Weinberg’s Law: If builders built
// vandewal at skyblue.com | buildings the way programmers wrote
// david.e.vandewalle at lmco.com | programs, then the first woodpecker that
// ICQ# 29090828 | came along would destroy civilization.

[Charset iso-8859-1 unsupported, filtering to ASCII…]

I already had this problem but I forgot how I had resolved it
but now you know it CAN be resolved.
Have you checked the GNUmake file ?

Umm… checked it for what? :wink: (I hate to sound dumb, but… I am :wink: )

Have you inserted it ?

???!

Is /usr/local/lib in your ldpath ?

Should be. The “gui” makefile references “-L. -lGUI”, so it’s using
"libGUI.a" in the “gui” directory. Just in case, I did copy the .a file
to /usr/local/lib.

if not, try a ldconfig with some option I don’t remember,

Heheh. :slight_smile: I certainly don’t know what the option is, either. :wink:

Does anyone else have any ideas?

I’m using “GUILIB Copyright 1997 Sam Lantinga”.
“make” builds everything without error.
“make hello” and “make hello_C” both return similar errors:

25/home/kendrick/SDL/SDL-demos/gui>make hello_C
cc -o hello_C hello_C.o -L. -lGUI -lpthread -L/usr/local/lib -Wl,-rpath,/usr/local/lib -lSDL -ldl
./libGUI.a(GUI_C.o): In function GUI_Create': GUI_C.o(.text+0x28): undefined reference to__eh_pc’
GUI_C.o(.text+0x31): undefined reference to __throw' GUI_C.o(.text+0x39): undefined reference toterminate(void)’
./libGUI.a(GUI_C.o): In function GUI_Widget_Create': GUI_C.o(.text+0xa4): undefined reference to__eh_pc’
GUI_C.o(.text+0xad): undefined reference to __throw' GUI_C.o(.text+0xb5): undefined reference toterminate(void)’
./libGUI.a(GUI_generic.o): In function GUI_GenericWidget type_info function': GUI_generic.o(.text+0x1b4): undefined reference to__rtti_si’
./libGUI.a(GUI_widget.o): In function GUI_Widget type_info function': GUI_widget.o(.text+0x40a): undefined reference to__rtti_user’
make: *** [hello_C] Error 1
26/home/kendrick/SDL/SDL-demos/gui>

I know NOTHING about C++, so, after not finding any references to,
for example, “terminate”, in any of the sources, I assume this is just
some funkiness on my end. (Although it sounds like others have had annoying
problems, too.)

I’m using:

  • Linux version 2.0.36 (root at porky.redhat.com) (gcc version 2.7.2.3) #1
    Tue Oct 13 22:17:11 EDT 1998
  • cc version 2.7.2.3 (looks to be a symb. link to gcc)
  • c++ and g++ both claim: “egcs-2.90.29 980515 (egcs-1.0.3 release)”
    (not a symbolic link for some reason, though… just two duplicate(?)
    binaries)
  • SDL 0.9.10

It’s not like this is amazingly important, but, I’m interested in seeing
this library, and pretty much all of the other examples I’ve tried compile
and run just fine.

Thanks!!!

-bill!

Does anyone else have any ideas?

I’m using “GUILIB Copyright 1997 Sam Lantinga”.
“make” builds everything without error.
“make hello” and “make hello_C” both return similar errors:

25/home/kendrick/SDL/SDL-demos/gui>make hello_C
cc -o hello_C hello_C.o -L. -lGUI -lpthread -L/usr/local/lib -Wl,-rpath,/usr/local/lib -lSDL -ldl
./libGUI.a(GUI_C.o): In function GUI_Create': GUI_C.o(.text+0x28): undefined reference to__eh_pc’
GUI_C.o(.text+0x31): undefined reference to `__throw’

Do you need to link with libstdc++ ? -lgcc? Something? :slight_smile:

-Sam Lantinga				(slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
Author of Simple DirectMedia Layer -
http://www.devolution.com/~slouken/SDL/

GUI_C.o(.text+0x28): undefined reference to __eh_pc' GUI_C.o(.text+0x31): undefined reference to__throw’

Do you need to link with libstdc++ ? -lgcc? Something? :slight_smile:

Bada-bing, bada-boom! It worked! :slight_smile: (And I learned something. Let’s see
if I can ever remember it :wink: )

Thanks Sam!

-bill!

GUI_C.o(.text+0x28): undefined reference to __eh_pc' GUI_C.o(.text+0x31): undefined reference to__throw’

Do you need to link with libstdc++ ? -lgcc? Something? :slight_smile:

Bada-bing, bada-boom! It worked! :slight_smile: (And I learned something. Let’s see
if I can ever remember it :wink: )

Which worked? -lstdc++ or -lgcc?

-Sam Lantinga				(slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
Author of Simple DirectMedia Layer -
http://www.devolution.com/~slouken/SDL/

GUI_C.o(.text+0x28): undefined reference to __eh_pc' GUI_C.o(.text+0x31): undefined reference to__throw’

Do you need to link with libstdc++ ? -lgcc? Something? :slight_smile:

Bada-bing, bada-boom! It worked! :slight_smile: (And I learned something. Let’s see
if I can ever remember it :wink: )

Which worked? -lstdc++ or -lgcc?

Oops, frankly I dunno… I used both, both times. :slight_smile: Let me see…

-lgcc did nothing (same errors). Not surprisingly, “-lstdc++” helped
(it compiled). This is for both “hello” and “hello_C”.

-bill!