I'm not sure how the CMake script is built, but you usually just have to check CMAKE_SHARED_LIBS and you'll end up with DLLs.
Not sure if you still need to link against zlib in your project when building a shared library, but you certainly need it to build the library in the first place.
Unresolved symbols are linker errors so they don't occur in one file, but it simply means that the implementation of the given function or class couldn't be found anywhere, which generally means you dilink the library that has those symbols.