Ehem, ARM
Rainer Schuetze
r.sagitario at gmx.de
Mon Dec 2 00:25:34 PST 2013
On 01.12.2013 14:30, Joakim wrote:
> //test.d
> import core.stdc.stdio;
>
> extern (C) int main() { fputs("doing this for real?", stderr); return 0;}
>
> It doesn't link on Win32, Win64, or Android. It works on linux and
> FreeBSD. Here's the output on platforms where it doesn't work:
The reason this does not work on Win32/Win64 comes from declaring main
as "extern(C)", which declares "main" for the C runtime. This prevents
adding an implicite include directive to add the phobos library to the
link. This happens only for D's main.
So, you should either drop the "extern(C)" or add phobos.lib to the
command line.
If including the library is not an option, you'll have to repeat the
respective declarations in your source. Just adding core.stdc.stdio to
the command line might also work.
More information about the Digitalmars-d
mailing list