Static linking and dynamic OpenGL |
Static linking and dynamic OpenGL |
Sam Lantinga
Guest
|
I don't think you can statically link an application and dynamically load GL under Linux. Ryan, have you ever done this? -Sam Lantinga, Senior Software Engineer, Blizzard Entertainment |
|||||||||||||||
|
Static linking and dynamic OpenGL |
Ryan C. Gordon
Guest
|
Statically linking what? OpenGL, SDL, both? Are you using the -static command line? --ryan. |
|||||||||||||
|
Static linking and dynamic OpenGL |
Stephen Anthony
Guest
|
On January 19, 2006 06:21 am, Ryan C. Gordon wrote:
Maybe I'm confusing the terms. Here's a clearer breakdown: Case 1) App is statically linked, but isn't linked to OpenGL at all. Doing 'ldd' results in 'static executable'. When using SDL_GL_LoadLibrary(), it causes a segfault. Case 2) App is using shared libs, and still isn't linked to OpenGL. Doing 'ldd' lists all the libs linked to the app. Using SDL_GL_LoadLibrary() in this case works fine. So, overall: 1) OpenGL is *never* linked to the app at all, and is loaded through SDL_GL_LoadLibrary(). 2) Both cases work fine in OSX and Win32. So it seems the problem only occurs when a static Linux binary attempts to dynamically load OpenGL through SDL_GL_LoadLibrary(). 3) The point of this whole exercise is to get around the brokenness of Linux wrt creating an app that will work everywhere. Notice that OSX and Win32 don't have a problem with that. Steve |
|||||||||||||||
|
Static linking and dynamic OpenGL |
Andreas Umbach
Guest
|
I dynamically link libc, pthread, X11 and OpenGL, and statically link everything else. I've never had a problem with that. My magic LIBS line is: LIBS = -L/usr/X11R6/lib -L/usr/local/lib -Wl,-rpath,/usr/local/lib,-Bstatic -lSDL_sound -lSDL -lsmpeg -lmikmod -lvorbisfile -lvorbis -logg -lXxf86dga -lXxf86vm -lXv -lXinerama -lXi -lpng -lz -lstdc++ -Wl,-Bdynamic -lpthread -lGL -lX11 -lXext -ldl - Andreas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20060120/b8421183/attachment.html |
|||||||||||||
|
Static linking and dynamic OpenGL |
Stephen Anthony
Guest
|
On January 20, 2006 06:33 am, Andreas Umbach wrote:
Thanks for that, I'll try it out. Steve |
|||||||||||||||
|