Static library for windows

Marius Gerbershagen marius.gerbershagen at gmail.com
Sat Mar 16 19:19:38 UTC 2019


Hi Jón,

> I was wonder if I could easily build a static version of ECL on windows 
> to link into other C++ projects without having to ship the ECL.dll with it.
> 
> There is a "ecl-static.lib" recipe in the Makefile in the ./msvc folder 
> which I can build after having built "all", but when linking that into 
> an application that does nothing but call cl_boot() the linker (VS2015) 
> complains with
> 
> LNK2019unresolved external symbol __imp__cl_boot referenced in function 
> _main
> 

The Makefile recipe is correct, however linking to the library it 
creates is a bit tricky and requires additional flags and system 
libraries to be added to the command line. For example

cl /Fe:test.exe /I C:\path\to\ecl\installation /DECL_API /MD test.c 
ecl-static.lib user32.lib ws2_32.lib shell32.lib

if you have compiled without the ECL_DEBUG option active (for 
compilation with this option active, replacing /MD by /MDd should work).

Best regards,
Marius Gerbershagen




More information about the ecl-devel mailing list