redundant definition problem when testing a module that is part of a library

Basile B. b2.temp at
Sun Nov 22 19:38:53 UTC 2020

This is a bug report but I cannot reduce to a simple case.
The problem doesn't happen if I use a simple test library.

test script:

=== ===
if [ -z "$DC"  ]; then
if [ ! -d styx ]; then
     git clone ""
cd styx
# e.g "Compile project" in an IDE
$DC $(find "src" -iname "*.d") -lib -of"bin/libstyx.a"
# e.g "Test current module" in an IDE
$DC "src/styx/lexer.d" "bin/libstyx.a" -I"src" -main -unittest

The following works fine:

   $ DC=dmd sh

When using ld2c I got linking errors

   $ DC=ldmd2 sh

More information about the digitalmars-d-ldc mailing list