简体   繁体   English

使用visual-studio 2010为Windows7 64编译OpenEXR失败

[英]Compiling OpenEXR for Windows7 64 using visual-studio 2010 fails

I am having trouble building OpenEXR for windows 7 using CMake. 我在使用CMake为Windows 7构建OpenEXR时遇到问题。

I am following directions described here 我按照这里描述的方向

The cmd output after I run the cmake command is as follows: 运行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>

This generates the solution with many projects, however, attempting to build project ALL_BUILDS fails. 这会生成包含许多项目的解决方案,但是,尝试构建项目ALL_BUILDS失败。

I noticed all non-compiling projects (except for porject ilmimf) complain about 我注意到所有非编译项目(除了porject ilmimf)都抱怨

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

Trying to build project IlmImf independently reports: 尝试独立构建项目IlmImf报告:

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

here is the full output for project ilmimf: 这是项目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 ==========

Note, I am running cmd and Visual Studio 2010 in administrator mode, tried compiling all configurations (debug, release, MinSizeRel, RelWithDebInfo) but nothing worked so far. 注意,我在管理员模式下运行cmd和Visual Studio 2010,尝试编译所有配置(debug,release,MinSizeRel,RelWithDebInfo)但到目前为止没有任何工作。

I had the exact same problem, though compiling for win32. 我有完全相同的问题,虽然为win32编译。 It needs dll s in lib directory created after building ilmbase . 它需要在构建ilmbase后创建的lib目录中的dll So my solution was to add that folder to windows' system path and everything works perfectly fine. 所以我的解决方案是将该文件夹添加到Windows的系统路径,一切正常。

Error   LNK1104 cannot open file '..\IlmImf\Debug\IlmImf-2_2.lib'   
Error   LNK1104 cannot open file '..\IlmImfUtil\Debug\IlmImfUtil-2_2.lib'

I had the same problems and I just copied Half.dll, Iex-2_2.dll and IlmThread-2_2.dll (three dll files generated by ilmbase) to b44ExpLogTable.exe folder. 我有同样的问题,我只是将Half.dll,Iex-2_2.dll和IlmThread-2_2.dll(由ilmbase生成的三个dll文件)复制到b44ExpLogTable.exe文件夹。 Then I built openexr successfully. 然后我成功构建了openexr。

I did as what RoozyGPLFX said, and overcame the "cmd.exe" exited error. 我按照RoozyGPLFX的说法做了,并克服了“cmd.exe”退出错误。 But I'm still curious why just add the imbase lib path in the VS2010 project's library path doesn't work, and I think this is some kind of bugs, because it doesn't mention we should add this to system "path" in the readme file. 但我仍然很好奇为什么只在VS2010项目的库路径中添加imbase lib路径不起作用,我认为这是一些错误,因为它没有提到我们应该将它添加到系统“路径”中自述文件。 To complement, when compiling with x64, after resolving this error, compiling IlmImf.dll can't find external symbols such as compress, compress2, uncompress which should be exported by the zlib. 为了补充,在使用x64进行编译时,在解决此错误后,编译IlmImf.dll无法找到外部符号,如compress,compress2,uncompress应该由zlib导出。 The error may due to the downloaded zlib version is Win32, and just recompiling the zlib source with x64 will solve this.( http://lists.gnu.org/archive/html/openexr-devel/2014-11/msg00004.html ) 错误可能是由于下载的zlib版本是Win32,只需用x64重新编译zlib源就可以解决这个问题。( http://lists.gnu.org/archive/html/openexr-devel/2014-11/msg00004.html

When the IlmImf is builded, it will generator a "b44ExpLogTable.exe" program to generator a header file. 当构建IlmImf时,它将生成“b44ExpLogTable.exe”程序以生成头文件。 This program b44ExpLogTable.exe needs correct dlls to run. 这个程序b44ExpLogTable.exe需要正确的dll才能运行。 Thus, we need to copy these related dlls into the directory or the system directory. 因此,我们需要将这些相关的dll复制到目录或系统目录中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM