Multiple declarations in a C++ namespace
Meta via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Thu Oct 30 21:55:06 PDT 2014
On Friday, 31 October 2014 at 02:01:00 UTC, Paul O'Neil wrote:
> I'm trying to bind to some C++ code, but when I compile the D
> side,
> there are errors. Here's my reduced test case:
>
> // C++
> namespace ns {
> void func1();
> void func2();
> }
>
> // D
> module cpp;
>
> extern(C++, ns) void func1();
> extern(C++, ns) void func2()
>
> dmd says:cpp_test.d(4): Error: namespace cpp.ns conflicts with
> namespace
> cpp.ns at cpp_test.d(3)
>
> What does this mean and how do I fix it?
>
> Thanks!
Did you try this?
extern(C++, ns)
{
void func1();
void func2();
}
The compiler probably thinks you're trying to declare two
separate namespaces. I'm not sure if this is intended or not.
More information about the Digitalmars-d-learn
mailing list