D source:

extern(C++) void thisWorks(const char* test);
extern(C++) void doesNotLink(const char** test);

void main() {
    char* baz1;
    char** baz2;
    thisWorks(baz1);
    doesNotLink(baz2);
}

CPP source:

#include <stdio.h>

void thisWorks(const char* test) {
    printf("hi\n");
}

void DoesNotLink(const char** test) {
    // not reached
}

The error given by the linker:
test.d:(.text._Dmain+0x21): undefined reference to `doesNotLink(char const* const*)'

What's happening? I know there are differences in const behavior between D and C++, but can't figure a way around it. Any sort of casting trick I tried doesn't seem to help.

Reply via email to