D and C++ undefined reference when namespace
Steven Schveighoffer
schveiguy at yahoo.com
Thu Mar 8 19:00:40 UTC 2018
On 3/8/18 1:56 PM, Markus wrote:
>
> You are right.
> $ dmd -c main.d
> $ nm main.o | grep some
> U _ZN4ns_a13some_functionEPN4ns_a7class_aE
> $ nm lib.o | grep some
> 0000000000000000 T _ZN4ns_a13some_functionEPNS_7class_aE
>
> But when i merge the main.d and other.d I get
> $ nm main.o | grep some
> U _ZN4ns_a13some_functionEPNS_7class_aE
>
> I tested dmd (2.079.0), gdc and ldc2. All got the same result. Which
> makes me think, that it's not a bug, but a "feature" :)
Ah interesting. What it looks like is that the symbol for the namespace
is considered different between the two files in D-land, but they have
the same name in C++-land. So it thinks it's not a back reference, but
really it should be.
-Steve
More information about the Digitalmars-d
mailing list