[Issue 11543] multiple definition of std.regex with shared library

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Nov 20 14:44:52 PST 2013


https://d.puremagic.com/issues/show_bug.cgi?id=11543



--- Comment #2 from aneas <alexander.breckel at gmail.com> 2013-11-20 14:44:50 PST ---
Here is another minimal test case:

main.d
---
import blubb;

void main() {
    f!int();
}
---

blubb.d
---
void f(T)() {
    final switch(false) {
        case true:
    }
}
---

$ dmd -defaultlib= -shared -fPIC -oflibblubb.so blubb.d
$ dmd -defaultlib=libphobos2.so -ofmain main.d -L-lblubb -L-L.
$ LD_LIBRARY_PATH=. ./main
Fatal Error while loading './libblubb.so':
    The module 'blubb' is already defined in './main'.

I couldn't reduce the test case any further. Using a non-final switch or an
if-statement does not trigger the error.

Maybe the error message correlates with this:

$ nm main
...
0000000000600f50 B _D5blubb12__ModuleInfoZ
...

whereas an error-free version of main contains no blubb.__ModuleInfo

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list