在Windows上,CMake出现zlib依赖错误

7

我正在尝试在Windows上构建OpenEXR 2.2,但是下载附带的说明未能按预期工作。虽然IlmBase的说明正常工作,但一旦到达OpenEXR说明步骤,由于zlib而失败。此时的步骤如下:

3. Go to http://www.zlib.net and download zlib 

我打开了一个网站,在这个部分开始的地方:当前版本可以在此公开获取:我下载了zlib源代码,版本1.2.8,zip文件格式...

接着,我进行了下一步,但出现了错误:

4. Launch a command window, navigate to the OpenEXR folder with 
CMakeLists.txt, and type command:     
    setlocal
    del /f CMakeCache.txt
    cmake 
      -DZLIB_ROOT=<zlib location>
      -DILMBASE_PACKAGE_PREFIX=<where you installed the ilmbase builds>
      -DCMAKE_INSTALL_PREFIX=<where you want to instal the openexr builds>
      -G "Visual Studio 10 Win64" ^
      ..\openexr

以下是我输入的命令:

cmake -DZLIB_ROOT=C:\Users\erik\Documents\zlib-1.2.8 -DILMBASE_PACKAGE_PREFIX=C:\Users\erik\Documents\ilmbase-2.2.0\bin -DCMAKE_INSTALL_PREFIX=C:\Users\erik\Documents\ilmbase-2.2.0\bin -G "Visual Studio 10 Win64" ^..\openexr-2.2.0

接下来是我遇到的错误:

无法找到ZLIB(缺少:ZLIB_LIBRARY)(找到版本“1.2.8”)

第一个问题是,说明书没有提到ZLIB_LIBRARY。第二个问题是,zlib下载看起来都是源代码,没有涉及.lib或.dll文件。

1个回答

3

您只下载了源代码,需要先编译它。或者从zlib主页下载预编译的DLL:“zlib compiled DLL”。

ZLIB_LIBRARY将从ZLIB_DIR派生,因此这部分是正确的。


1
因此,步骤3.5:构建zlib,然后将ZLIB_ROOT设置为构建目录。 - elveatles

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接