【问题标题】:Compiling OpenEXR for Windows7 64 using visual-studio 2010 fails使用 visual-studio 2010 为 Windows7 64 编译 OpenEXR 失败
【发布时间】:2015-01-02 16:04:39
【问题描述】:

我在使用 CMake 为 Windows 7 构建 OpenEXR 时遇到问题。

我正在遵循here 描述的指示

我运行cmake命令后的cmd输出如下:

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

D:\openexr-2.2.0>setlocal

D:\openexr-2.2.0>cmake -DZLIB_ROOT="C:\Program Files\zlib" -DILMBASE_PACKAGE_PREFIX="d:\ilmbase-2.2.0\builds" -DCMAKE_INSTALL_PREFIX="d:\openexr-2.2.0" -G "Visual Studio 10 Win64" ..\openexr-2.2.0
-- The C compiler identification is MSVC 16.0.40219.1
-- The CXX compiler identification is MSVC 16.0.40219.1
-- Check for working C compiler using: Visual Studio 10 Win64
-- Check for working C compiler using: Visual Studio 10 Win64 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler using: Visual Studio 10 Win64
-- Check for working CXX compiler using: Visual Studio 10 Win64 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found ZLIB: C:/Program Files/zlib/lib/zlib.lib (found version "1.2.8")
ILMBASE_PACKAGE_PREFIX = d:\ilmbase-2.2.0\builds
-- Performing Test HAVE_GCC_INLINE_ASM_AVX
-- Performing Test HAVE_GCC_INLINE_ASM_AVX - Failed
-- Performing Test HAVE_SYSCONF_NPROCESSORS_ONLN
-- Performing Test HAVE_SYSCONF_NPROCESSORS_ONLN - Failed
-- Configuring done
-- Generating done
-- Build files have been written to: D:/openexr-2.2.0

D:\openexr-2.2.0>

这会生成包含许多项目的解决方案,但是,尝试构建项目 ALL_BUILDS 会失败。

我注意到所有非编译项目(除了 porject ilmimf)都抱怨

error LNK1181: cannot open input file '..\IlmImf\Release\IlmImf-2_2.lib'

尝试构建项目 IlmImf 独立报告:

error MSB6006: "cmd.exe" exited with code -1073741515.

这是项目 ilmimf 的完整输出:

1>------ Build started: Project: ZERO_CHECK, Configuration: Release x64 ------
1>Build started 06/11/2014 09:43:21.
1>InitializeBuildStatus:
1>  Creating "x64\Release\ZERO_CHECK\ZERO_CHECK.unsuccessfulbuild" because "AlwaysCreate" was specified.
1>FinalizeBuildStatus:
1>  Deleting file "x64\Release\ZERO_CHECK\ZERO_CHECK.unsuccessfulbuild".
1>  Touching "x64\Release\ZERO_CHECK\ZERO_CHECK.lastbuildstate".
1>
1>Build succeeded.
1>
1>Time Elapsed 00:00:00.04
2>------ Build started: Project: IlmImf, Configuration: Release x64 ------
2>Build started 06/11/2014 09:43:21.
2>InitializeBuildStatus:
2>  Touching "IlmImf.dir\Release\IlmImf.unsuccessfulbuild".
2>CustomBuild:
2>  Building Custom Rule D:/openexr-2.2.0/IlmImf/CMakeLists.txt
2>  CMake does not need to re-run because D:\openexr-2.2.0\IlmImf\CMakeFiles\generate.stamp is up-to-date.
2>  Generating b44ExpLogTable.h
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code -1073741515.
2>
2>Build FAILED.
2>
2>Time Elapsed 00:00:00.14
========== Build: 1 succeeded, 1 failed, 2 up-to-date, 0 skipped ==========

注意,我在管理员模式下运行 cmd 和 Visual Studio 2010,尝试编译所有配置(调试、发布、MinSizeRel、RelWithDebInfo),但到目前为止没有任何效果。

【问题讨论】:

    标签: c++ visual-studio-2010 visual-c++ cmake openexr


    【解决方案1】:
    Error   LNK1104 cannot open file '..\IlmImf\Debug\IlmImf-2_2.lib'   
    Error   LNK1104 cannot open file '..\IlmImfUtil\Debug\IlmImfUtil-2_2.lib'
    

    我遇到了同样的问题,我只是将 Half.dll、Iex-2_2.dll 和 IlmThread-2_2.dll(ilmbase 生成的三个 dll 文件)复制到 b44ExpLogTable.exe 文件夹。然后我成功构建了openexr。

    【讨论】:

    【解决方案2】:

    当 IlmImf 被构建时,它会生成一个“b44ExpLogTable.exe”程序来生成一个头文件。此程序 b44ExpLogTable.exe 需要正确的 dll 才能运行。因此,我们需要将这些相关的dll复制到目录或系统目录中。

    【讨论】:

      【解决方案3】:

      我按照 RoozyGPLFX 所说的做了,并克服了“cmd.exe”退出错误。但是我还是很好奇为什么只是在VS2010项目的库路径中添加imbase lib路径是行不通的,而且我认为这是某种bug,因为它没有提到我们应该将这个添加到系统“路径”中自述文件。 补充一下,用x64编译时,解决这个错误后,编译IlmImf.dll找不到应该由zlib导出的compress、compress2、uncompress等外部符号。错误可能是下载的zlib版本是Win32,只要用x64重新编译zlib源就可以解决这个问题。(http://lists.gnu.org/archive/html/openexr-devel/2014-11/msg00004.html)

      【讨论】:

        【解决方案4】:

        我遇到了完全相同的问题,虽然是为 win32 编译的。它需要在构建ilmbase 后创建的lib 目录中的dll。 所以我的解决方案是将该文件夹添加到 Windows 的系统路径中,一切正常。

        【讨论】:

        • 非常感谢。正要伤害自己。
        • 我遇到了这个确切的问题,并通过将所有 DLL 复制到 OpenEXR/IlmImf/Debug 文件夹中来修复它。将 lib 文件夹添加到系统路径对我不起作用。
        猜你喜欢
        • 1970-01-01
        • 2011-03-04
        • 2017-01-21
        • 2011-04-28
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-05-21
        • 1970-01-01
        相关资源
        最近更新 更多