When you declare an extern(C) function inside a D function it seems to continue to use D's name mangling, which is unexpected for me. For instance: void main() { extern(C) void foo(int); foo(42); } Undefined symbols for architecture x86_64: "__D4test4mainFZv3fooUiZv", referenced from: __Dmain in test.o Is this a bug?