There's an edge-case here to be aware of, if you don't reference the symbol there won't be linker errors (at least with optlink, and this makes sense when you think about it): // no linker errors extern extern(C) int x; void main() { } // linker errors extern extern(C) int x; void main() { int z = x; }