Newbie question: COM programming and linking to Windows libraries

Daniel Keep daniel.keep.lists at
Wed Mar 11 14:48:18 PDT 2009

Patrick Kristiansen wrote:
> ...
> Now, this is probably obvious to some people - but not to me. Why doesn't this work? Why does OPTLINK fail and tell me that the format of the .lib file is wrong? Is it because Digital Mars compilers produce .lib files in a different format? Is it because I have the 64 bit SDK installed, and DMD and optlink only produce and consume 32 bit object files and libraries?
> Please enlighten me ;-)
> Thanks in advance.
> -Patrick

The DM toolchain produces and consumes OMF object files, while I suspect
the SDK uses COFF.  Also, the toolchain is 32-bit, not 64-bit.

There's a tool called implib which can generate a .lib file that
DMD/OPTLINK can use.

Documentation is here: <>.

You can get it by going to <>, clicking on
"Download Digital Mars C compiler", accept the agreement, and then
scroll down to "Basic Utilities".

  -- Daniel

More information about the Digitalmars-d-learn mailing list