[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Static Linking Throuble with OpenGL
- To: linuxgames@sunsite.dk
- Subject: Static Linking Throuble with OpenGL
- From: Ingo Ruhnke <grumbel@gmx.de>
- Date: Sun, 17 Aug 2003 14:10:12 +0200
- Delivered-to: archiver@seul.org
- Delivered-to: mailing list linuxgames@sunsite.dk
- Delivery-date: Sun, 17 Aug 2003 08:10:31 -0400
- Mailing-list: contact linuxgames-help@sunsite.dk; run by ezmlm
- Reply-to: linuxgames@sunsite.dk
- Sender: Ingo Ruhnke <ingo@penpen.seul.org>
- User-agent: Gnus/5.090018 (Oort Gnus v0.18) Emacs/21.3 (gnu/linux)
Hiho,
I am currently struggeling to get a static binary for a game of mine
build. For games that just use X11 it wasn't too difficult, I just had
to add '-static' and all the required libraries (and libraries which
where required by libraries) and that would produce a working static
binary which ran on all x86 Linux systems so far, I didn't had a
single bug report. But now when it comes to OpenGL which has to be
linked dynamically as far as I know, this whole process no longer
works all that easily. What I do is like this:
$(CXX) -s -nodefaultlibs -o game sprite.o foo.o ...
-Wl,-Bstatic [all libraries] \
-Wl,-Bdynamic -lGL -lc
This produces a binary that only depends on libc and OpenGL, which is
fine and works on many systems, but by far not all. On systems which
have older glibc's the binary will fails to run and aborts directly at
startup.
On the other side if I try to also link also libc statically it won't
work at all, the resulting binary will installly crash at startup
somewhere in dlopen(), so a static linked libc together with a dynamic
OpenGL doesn't really seem to work.
So does anybody know how I can produce a binary that uses OpenGL that
will work on all x86 Linux systems out there or at least the ones that
have a correct OpenGL setup?
--
WWW: http://pingus.seul.org/~grumbel/
Games: http://pingus.seul.org/~grumbel/gamedesigns/
JabberID: grumbel@jabber.org
ICQ: 59461927