modelon-community / fmi-library

C library for importing FMUs
Other
115 stars 34 forks source link

MSVC Debug build 3.0a3 can't find zlib.lib #108

Closed yoerg closed 10 months ago

yoerg commented 11 months ago

Building 3.0a3 as a MSVC project with

cmake -G "Visual Studio 16 2019" "../fmi-library-3.0a2"
cmake --build . --config Debug

failes to link fmizip.lib and aborts the build:

fmizip.vcxproj -> C:\Hubele\scm\faster-bitbucket\fmi-library-build\buildMSVC30a3\Debug\fmizip.lib
LINK : fatal error LNK1104: cannot open file 'zlibext\Debug\zlib.lib' [C:\Hubele\scm\faster-bitbuck
et\fmi-library-build\buildMSVC30a3\compress_test_fmu_zip.vcxproj]

The reason appears to be that the zlib Debug configuration build produces a zlibd.lib instead of zlib.lib. I've attached a crude workaround.

cmake version 3.26.4

nilotpalutkalit commented 11 months ago

Another workaround is to use find_package for zlib by enabling "FMILIB_FIND_PACKAGE_ZLIB" in CMAKE Options

modelonrobinandersson commented 10 months ago

Thank you both for your suggestions, I'll see if we can resolve this by next week.