Calling D from C

Jacob Carlborg doob at me.com
Sun Nov 24 06:02:17 PST 2013


On 2013-11-24 08:22, evilrat wrote:

> ok i find out what's your problem. here is 2 ways of solving this problem.
>
> 1) build like you do already but add to gcc call phobos lib, so it will
> looks like "gcc bar.c foo.o /usr/share/dmd/lib/libphobos2.a"
>
> 2) build with foo.d with "dmd foo.d -lib" which generates proper lib
> file with all necessary stuff from phobos and whatever.
>
> i specifically choose this order so you can think whats happened.

Compiling with DMD and the -v flag shows a verbose output and exactly 
how DMD calls GCC to link everything.

-- 
/Jacob Carlborg


More information about the Digitalmars-d-learn mailing list