Linker error: zlib.lib not found

My setup:

  • Windows 10
  • building Cinder 0.9.1 from scratch
  • VS 2022
  • Toolset “v141”
  • Windows SDK version: 10.0.17134.0

I ran cmake, then opened the generated cinder.sln, configured the Win SDK version (as above) for all the projects in the sln, and tried to build the “cinder” project.

2>LINK : fatal error LNK1181: cannot open input file 'C:\Users\logix\Desktop\code_\libs\misc\cinder_0.9.1\lib\msw\x64\zlib.lib'

and indeed zlib.lib is absent there. The foider contains other .lib files though - libEGL, libpng, some boost ones…

Any ideas appreciated :slight_smile:

From memory, zlib is included with cinder in source form and is compiled alongside the rest of the cinder code, so it shouldn’t need to link with it separately. It’s not the prettiest solution, but can you just remove where it’s trying to link with zlib.lib and try to build cinder again to see if it’s just being added as a library dependency erroneously?

Edit* I just looked at my source folder and 0.9.1 does try to link with zlib specifically, whereas the the more recent master branch i use from github doesn’t, is there any particular reason you’re tied to 0.9.1 rather than the latest?

I looked at the “project options” dialog in VS (for the Cinder project in the Cinder solution) and looked for any option wrt what libs to link with. But there was no “Linker” settings category (unlike in my personal projects). There was a “Librarian” one, with an “Additional dependencies” field in it. But that field was blank (I expected it would mention zlib.lib).

Anyway, I found zlib.lib mentioned in four places in cinder.vcxproj, and removed it from there. Now cinder builds successfully. So we have a happy ending :slight_smile:

1 Like