Calling D function from C

Bruce Adams tortoise_74 at yeah.who.co.uk
Wed Apr 23 01:16:41 PDT 2008


On Wed, 23 Apr 2008 07:36:26 +0100, Johan Granberg  
<lijat.meREM at OVEgmail.com> wrote:

> Jonathan Crapuchettes wrote:

>> ------------ Compiled As ---------------
>> /opt/dmd/bin/dmd test.d -c
>> gcc main.c test.o -m32 -o tester -lphobos -lpthread -lm
>> Linker Error...
>
> The code looks ok to me, wath if you compile the c code first and then  
> use
> dmd to link it (dmd probably uses some linker flags you did not think of)

Although in theory both compilers are generating compatible ELF objects I  
would be wary of mixing
compilers this way and much more comfortable using either dmc & dmc or gdc  
& gcc together.


More information about the Digitalmars-d-learn mailing list