Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 36635 - Hack to fix sdl-gui ebuild
Summary: Hack to fix sdl-gui ebuild
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: SpanKY
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-12-28 03:38 UTC by Paul Eggleton
Modified: 2003-12-30 21:45 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Output from "emerge info" (emerge-info.log,1.34 KB, text/plain)
2003-12-28 15:22 UTC, Paul Eggleton
Details
Excerpt from config.log - trying to link test program against broken SDL_gui (eboxy-config.log,1.26 KB, text/plain)
2003-12-28 15:23 UTC, Paul Eggleton
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Eggleton 2003-12-28 03:38:47 UTC
The ebuild for sdl-gui is broken (no doubt the reason why it is masked). I'm not sure if this qualifies as a satisfactory fix, but it works: all you need to do is add the following as the first line in the src_compile section of sdl-gui-0.10.3.ebuild:

CXXFLAGS="$CXXFLAGS -lstdc++"

My application uses SDL_gui and this fix has worked well for me. However, I'm sure with a little further digging someone could fix the SDL_gui code so that it doesn't need this hack.
Comment 1 SpanKY gentoo-dev 2003-12-28 11:20:19 UTC
i dont see how sdl-gui is masked other than it's ~x86 ...
Comment 2 SpanKY gentoo-dev 2003-12-28 11:25:09 UTC
oh, and it compiles just fine over here ... could you provide some `emerge info` ?
Comment 3 Paul Eggleton 2003-12-28 15:21:35 UTC
I thought being ~x86 meant that it was masked. Not "hard-masked", which I understand is a different thing.

It always compiles, but the problem is that when you try to link against it you get errors about undefined symbols new and delete etc. This is what made me try to link SDL_gui against libstdc++ at build time, and it seems to work.

This problem affects several of my machines here, one of which is running Debian. However, it does not appear on two other systems running older versions of gcc/glibc.

I'll attach the emerge info output from one of my machines along with part of config.log when trying to build my application (which attempts to link a test program against SDL_gui and fails). I'm confident that building any application that attempts to link against SDL_gui will result in the same problem.
Comment 4 Paul Eggleton 2003-12-28 15:22:14 UTC
Created attachment 22766 [details]
Output from "emerge info"
Comment 5 Paul Eggleton 2003-12-28 15:23:12 UTC
Created attachment 22767 [details]
Excerpt from config.log - trying to link test program against broken SDL_gui
Comment 6 SpanKY gentoo-dev 2003-12-28 18:44:19 UTC
to be honest, i think this is more of a non-bug ;)

SDL_gui is C++ ... thus using gcc to compile c++ sources is incorrect ...
if you change your test program to use g++ instead of gcc, does the linker errors go away ?
Comment 7 Paul Eggleton 2003-12-29 01:44:45 UTC
Oops... You're right. I just fixed the autoconf script to use C++ and it now works (why didn't I see that earlier... gah! Sorry to waste your time.)

However, I believe SDL_gui is meant to be linked against C programs as well - at least a C API is provided. Maybe you're supposed to also link your C program against libstdc++ if you want to use SDL_gui.
Comment 8 SpanKY gentoo-dev 2003-12-29 05:24:02 UTC
hmm, i'll double check on the C api thing
Comment 9 SpanKY gentoo-dev 2003-12-30 21:45:29 UTC
just thought about it again and the answer is, it's not a bug for the same reason ;)

the SDL_gui.h has this:
#ifdef __cplusplus
<C++ code>
#else
<C code>
#endif

so if you get those linker errors it's cause you get C++ code in that C file of yours ;)