[LAD] Writing a library?

Emanuel Rumpf xbran at web.de
Wed Jul 23 07:07:20 UTC 2008


2008/7/23 Darren Landrum <darren.landrum at sbcglobal.net>:

> Now, I know about writing a good header file, and its associated class,
> and all that, but I have no knowledge of how to write it as a dynamic
> library.

it's about like this:
write a file with the functions inside
write a header file, define the functions as public
compile as PIC (position independent code)
link as shared library

C-example:
compile:
   gcc -c -fPIC -I/usr/include/ myfile.c
( creates myfile.o )
link:
  gcc  -omyfile.so -shared myfile.o -L/usr/lib/ -lanydependancy
( creates myfile.so )


autoconf, automake etc. are old
If you wanted to, I'd suggest to use a more recent build tool (e.g.
scons, cmake, git, .. )



More information about the Linux-audio-dev mailing list