Written by anduril462, this article covers creating and configuring shared libraries on Linux, using GCC: Shared libraries with GCC on Linux - Cprogramming.com
Written by anduril462, this article covers creating and configuring shared libraries on Linux, using GCC: Shared libraries with GCC on Linux - Cprogramming.com
Nice job. I learned what "PIC" refers to.
C programming resources:
GNU C Function and Macro Index -- glibc reference manual
The C Book -- nice online learner guide
Current ISO draft standard
CCAN -- new CPAN like open source library repository
3 (different) GNU debugger tutorials: #1 -- #2 -- #3
cpwiki -- our wiki on sourceforge
My highest compliments to anduril462 for an exceptionally well written article. You've covered everything that in my view is important knowing about shared library creation and usage. (Especially like the nice formatting you've used to highlight the example commands and output. Makes it all the more readable.)
For anyone who wishes to build on knowledge gained from this article by learning about loading C++ functions and classes dynamically using the dlopen API, I found this useful: C++ dlopen mini HOWTO
It's a nice, concise article on the mechanics of producing a shared library (which tools to use, how to invoke them, etc.)
What is missing is a discussion of the implications of shared code -- the requirements imposed by backwards compatibility, interface stability, binary compatibility in general. Compiling position-independent and linking dynamically is really only the first step to creating a shared library. Nailing the right interface on the first try, or at least setting yourself up to be able to fix it in the future without forcing a global recompile of everything that depends on your library, is the next step.
EDIT: Just saying It's a great contribution, it just leaves open the possibility of more in the future.
Code://try //{ if (a) do { f( b); } while(1); else do { f(!b); } while(1); //}
Thanks for the positive response.
@aj17: All credit to webmaster for the nice formatting. Thanks for the dlopen reference, maybe it can be linked in my article or in a short follow up.
@brewbuck: Yeah, that would be a good idea. Care to give it a shot?
This was something I wanted to learn, thanks for the article. Just had a first read through, may have questions in the next few days as I mess with it.
W7, Ubuntu -- mingw, gcc, g++, code::blocks, emacs, notepad++