How to use library compiled with Microsoft Visual Studio 2015 in D?

Jacob Carlborg via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Dec 4 23:21:30 PST 2016


On 2016-12-05 07:44, unDEFER wrote:
> Hello! I have compiled libdb (BerkeleyDB) with Microsoft Visual Studio
> 2015.
> 1) "Debug" mode. I have libdb53d.dll file. Do implib.
> The linker doesn't seen symbols from the library! Do "lib -l". In the
> list of symbols "db_create", linker searches "_db_create". Is it the
> problem?
> 2) "Debug-Static" mode. I have libdb53d.lib file. Try to compile. linker
> say that it has unsupported COFF format. Read about COFF2OMF, buy
> extended utils to get it.
> $ coff2omf libdb53d.lib
> Segmentation Fault
> Try like on page http://www.digitalmars.com/ctg/coff2omf.html:
> $ link /lib /convert file.lib
> LINK : warning LNK4044: unrecognized option '/convert'; ignored
>
> So nothing works. How to use a library compiled with Microsoft Visual
> Studio 2015 in D?

If you compile your D code with the "-m32mscoff" flag it will produce 
COFF objects and use the Visual Studio tool chain (linker and runtime). 
Compiling for 64bit (-m64) will always produce COFF objects.

-- 
/Jacob Carlborg


More information about the Digitalmars-d-learn mailing list