building shared libraries

Levi Pearson levi at cold.org
Wed Jan 2 08:36:14 MST 2008


"Andres Gonzalez" <gonzo at agoralabs.com> writes:

> I am porting a DLL (originally developed for MS Windows) to linux and
> I have a couple of basic questions about shared libraries in linux.
>
> How do you control what symbols and function names are exported or
> available when building the shared library?
>
> My code is compiling fine (using position independent code) and I am
> producing the .so file. When I run nm on the .so file, it shows tons
> and tons of symbols. My function names are also mangled. I want to
> only have a few select API functions available public ally.

Are you building a C or a C++ library?  If you're using a C++ compiler
to build a C library, you have to tell it to provide C symbols instead
of C++ ones.

                --Levi



More information about the PLUG mailing list