Hi,
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
LNK2019 unresolved external symbol __imp__cl_boot referenced in function _main
When looking into the symbols of the ecl-static.lib (created by MS dumpbin /symbols) the cl_boot function is defined but is UNDEF-ed so that the linker tries to find __imp__cl_boot which is not in the ecl-static.lib
Looking through the mail list I came upon the mention of using --disable-shared when configuring, which works for me on Linux, but I don't know how to add that flag to the nmake environment on Windows (or if it is there at all)
Regards,
Jón Hallur
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