The module 'foo' is already defined in 'libmylib.so'

Timothee Cour via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Dec 1 14:05:06 PST 2016


I want to update a library with new symbols (ie partial recompilation):

libmylib.so : compiled from bar.d and foo.d

now update the file foo.d

dmd -c -fPIC foo.d -offoo.o

clang++ -o libmylib_update.so foo.o -shared -Wl,-lmylib

When trying to dlopen libmylib_update.so from C++ it fails with:
The module 'foo' is already defined in 'libmylib.so'

(it somehow works when the dlopen is called from D)

How would I achieve that?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20161201/7fc6bf73/attachment.html>


More information about the Digitalmars-d-learn mailing list