extern(C++, ns) is wrong

tide tide at tide.tide
Wed Sep 5 00:49:02 UTC 2018


On Wednesday, 5 September 2018 at 00:35:50 UTC, Manu wrote:
> On Tue, 4 Sep 2018 at 17:30, tide via Digitalmars-d 
> <digitalmars-d at puremagic.com> wrote:
>>
>> On Tuesday, 4 September 2018 at 23:32:31 UTC, Walter Bright 
>> wrote:
>> > On 9/4/2018 3:33 PM, Manu wrote:
>> >> file1.d
>> >> ---------
>> >> module bliz.ecs.component_access;
>> >> import bliz.ecs.table;
>> >> import bliz.ecs.types;
>> >> extern(C++, bliz):
>> >> // things...
>> >>
>> >> Error: 
>> >> project\ecs\include\d2\bliz\ecs\component_access.d(7):
>> >> Error:
>> >> namespace `bliz.ecs.component_access.bliz` conflicts with
>> >> import
>> >> `bliz.ecs.component_access.bliz` at
>> >> project\ecs\include\d2\bliz\ecs\component_access.d(3)
>> >>
>> >> file2.d
>> >> ---------
>> >> module bliz.ecs.table;
>> >> import bliz.ecs.types;
>> >> extern(C++, bliz):
>> >> // things...
>> >>
>> >> Error: project\ecs\include\d2\bliz\ecs\table.d(11): Error:
>> >> namespace
>> >> `bliz.ecs.table.bliz` conflicts with import
>> >> `bliz.ecs.table.bliz` at
>> >> project\ecs\include\d2\bliz\ecs\table.d(5)
>> >
>> > I can't help because the examples are incomplete. There is 
>> > no line 5 in table.d, nor a line 7 in component_access.d The 
>> > error messages are not generated from the code posted.
>>
>> That's all you need really, any symbol you add will cause the 
>> error.
>>
>> extern(C++, bliz):
>>
>> created a symbol "bliz", you can't import a package from 
>> "bliz" cause then there's a symbol clash. I thought you 
>> implemented extern(C++) ...
>
> And yes, the example is actually complete. Again, but I'll 
> simplify the filenames:
>
> ns/bar.d
> -------------
> module ns.bar;
> import ns.baz;
> extern(C++, ns):
>
> ns/baz.d
> -------------
> module ns.baz;
> import ns.bar;
> extern(C++, ns):
>
>
>> dmd ns/bar.d ns/baz.d

Judging by the name of the modules are you working on an Entity 
Component System for D :o ?


More information about the Digitalmars-d mailing list