Using D libs in C

GreatEmerald pastas4 at gmail.com
Tue Jan 18 23:01:08 PST 2011


All right, it worked, when the D side is this:

module techborg;
import std.c.stdio;

extern(C):
    shared int ResultD;

    int Process(int Value)
    {
        printf("You have sent the value: %d\n", Value);
        ResultD = (Value % 5);
        return ResultD;
    }

However, if I wanted to use printf() from std.stdio, dmc can't link
the library any more and complains about undefined symbols:
techborg.lib
 Warning 140: Library probably needs FIXLIB
techborg.lib(techborg)
 Error 42: Symbol Undefined _D3std5stdio12__ModuleInfoZ

Also, what was that solution you found for converting OMF->COFF? I
can't seem to find the post you mentioned.


More information about the Digitalmars-d-learn mailing list