Can't get D calling C to build.

Bob Cowdery bob at bobcowdery.plus.com
Fri Aug 20 10:14:39 PDT 2010


 A bit more playing and I see that it's assumed that C code is compiled
with dmc and then the  D code can be compiled with dmd which will also
link in the obj left by dmc. It wasn't clear at all that to make things
work easily one needs to use both the C and D Digital Mars compilers.

Code::Blocks has led me a right old game by adding in switches the
compiler doesn't understand. Eventually got it configured to use the dmc
and dmd toolchains and managed to build and link in a C library. Some
progress at last.

bob

On 20/08/2010 09:54, Bob Cowdery wrote:
>  On 20/08/2010 06:51, Kagamin wrote:
>> Bob Cowdery Wrote:
>>
>>> Now I've tried this with just D code and it writes the output and runs
>>> so I know something works. Does anyone know where to look, is it
>>> Code::Blocks, compiler, stupidity (probably).
>> On windows dmd uses ancient OMF object format, but gcc compiles to COFF.
> Thanks for the hint. I found an object file converter and converted the
> C obj file to OMF and it now builds. It seems very odd to me to have to
> jump through this loop. This should be up in big red letters on the D
> site somewhere.
>
> bob



More information about the Digitalmars-d-learn mailing list