shared libraray

Alexandre Oliva aoliva@redhat.com
Fri Nov 24 12:57:00 GMT 2000


On Nov 24, 2000, Kevin Su <ksu@kinaare.net> wrote:

>     I recently tried to create a shared library.  I found that if  I
> compile the source with  g++, instead of gcc, symbol of functions in the
> shared library can not be found with dlsym(), it returns NULL with an
> error from dlerror().  With gcc, everything is working fine.

Declare functions you want to dlsym() as extern "C", so that their
names don't get mangled.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me


More information about the Gcc-help mailing list