简体   繁体   English

在Windows x64上安装libpng时出错

[英]Error in installing libpng for windows x64

I'd tried install and reinstall libpng from http://libpng.org/pub/png/libpng.html . 我尝试从http://libpng.org/pub/png/libpng.html安装并重新安装libpng I need this to use for face verification using bob (hosted by python ). 我需要使用它来使用bob (由python托管)进行面部验证。 I'd followed the first step by installing libzip and ziplib from this answer . 我按照第一步通过此答案安装libzipziplib However I keep getting error. 但是我一直在出错。

Here I list the result from cmake : 在这里,我列出了cmake的结果:

-- Building for: Visual Studio 14 2015
-- Found ZLIB: c:/Python27/work/libpng-1.6.26/lib/zlib.lib (found version "1.2.8")
-- Performing Test HAVE_LD_VERSION_SCRIPT
-- Performing Test HAVE_LD_VERSION_SCRIPT - Failed
-- Performing Test HAVE_SOLARIS_LD_VERSION_SCRIPT
-- Performing Test HAVE_SOLARIS_LD_VERSION_SCRIPT - Failed
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Python27/work/libpng-1.6.26/libpng-1.6.26

Then, this is I get when build libpng.sln : 然后,这是我在构建libpng.sln时得到的:

Severity    Code    Description Project File    Line    Suppression State
Warning MSB8028 The intermediate directory (x64\Debug\) contains files shared from another project (png.vcxproj, pngfix.vcxproj, pngimage.vcxproj, pngstest.vcxproj, pngtest.vcxproj, pngunknown.vcxproj, pngvalid.vcxproj, png_static.vcxproj).  This can lead to incorrect clean and rebuild behavior.    png-fix-itxt    C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets   392 
Warning MSB8028 The intermediate directory (x64\Debug\) contains files shared from another project (png-fix-itxt.vcxproj, pngfix.vcxproj, pngimage.vcxproj, pngstest.vcxproj, pngtest.vcxproj, pngunknown.vcxproj, pngvalid.vcxproj, png_static.vcxproj).  This can lead to incorrect clean and rebuild behavior.   png C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets   392 
Error   LNK1112 module machine type 'x64' conflicts with target machine type 'X86'  png C:\Python27\work\libpng-1.6.26\libpng-1.6.26\x64\Debug\png.obj  1   
Error   LNK1112 module machine type 'x64' conflicts with target machine type 'X86'  png-fix-itxt    C:\Python27\work\libpng-1.6.26\libpng-1.6.26\x64\Debug\png-fix-itxt.obj 1   
Warning MSB8028 The intermediate directory (x64\Debug\) contains files shared from another project (png-fix-itxt.vcxproj, png.vcxproj, pngfix.vcxproj, pngstest.vcxproj, pngtest.vcxproj, pngunknown.vcxproj, pngvalid.vcxproj, png_static.vcxproj).  This can lead to incorrect clean and rebuild behavior.    pngimage    C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets   392 
Warning MSB8028 The intermediate directory (x64\Debug\) contains files shared from another project (png-fix-itxt.vcxproj, png.vcxproj, pngimage.vcxproj, pngstest.vcxproj, pngtest.vcxproj, pngunknown.vcxproj, pngvalid.vcxproj, png_static.vcxproj).  This can lead to incorrect clean and rebuild behavior.  pngfix  C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets   392 
Warning MSB8028 The intermediate directory (x64\Debug\) contains files shared from another project (png-fix-itxt.vcxproj, png.vcxproj, pngfix.vcxproj, pngimage.vcxproj, pngstest.vcxproj, pngtest.vcxproj, pngvalid.vcxproj, png_static.vcxproj).  This can lead to incorrect clean and rebuild behavior.  pngunknown  C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets   392 
Error   LNK1104 cannot open file 'Debug\libpng16d.lib'  pngimage    C:\Python27\work\libpng-1.6.26\libpng-1.6.26\LINK   1   
Error   LNK1104 cannot open file 'Debug\libpng16d.lib'  pngunknown  C:\Python27\work\libpng-1.6.26\libpng-1.6.26\LINK   1   
Error   LNK1104 cannot open file 'Debug\libpng16d.lib'  pngfix  C:\Python27\work\libpng-1.6.26\libpng-1.6.26\LINK   1   
Warning MSB8028 The intermediate directory (x64\Debug\) contains files shared from another project (png-fix-itxt.vcxproj, png.vcxproj, pngfix.vcxproj, pngimage.vcxproj, pngtest.vcxproj, pngunknown.vcxproj, pngvalid.vcxproj, png_static.vcxproj).  This can lead to incorrect clean and rebuild behavior.    pngstest    C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets   392 
Warning MSB8028 The intermediate directory (x64\Debug\) contains files shared from another project (png-fix-itxt.vcxproj, png.vcxproj, pngfix.vcxproj, pngimage.vcxproj, pngstest.vcxproj, pngtest.vcxproj, pngunknown.vcxproj, png_static.vcxproj).  This can lead to incorrect clean and rebuild behavior.    pngvalid    C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets   392 
Warning MSB8028 The intermediate directory (x64\Debug\) contains files shared from another project (png-fix-itxt.vcxproj, png.vcxproj, pngfix.vcxproj, pngimage.vcxproj, pngstest.vcxproj, pngunknown.vcxproj, pngvalid.vcxproj, png_static.vcxproj).  This can lead to incorrect clean and rebuild behavior.   pngtest C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets   392 
Error   LNK1104 cannot open file 'Debug\libpng16d.lib'  pngvalid    C:\Python27\work\libpng-1.6.26\libpng-1.6.26\LINK   1   
Error   LNK1104 cannot open file 'Debug\libpng16d.lib'  pngtest C:\Python27\work\libpng-1.6.26\libpng-1.6.26\LINK   1   
Error   LNK1104 cannot open file 'Debug\libpng16d.lib'  pngstest    C:\Python27\work\libpng-1.6.26\libpng-1.6.26\LINK   1

As far as I know, the one that I should deal is version x64. 据我所知,我应该处理的是x64版本。 And also it looks like cmake does not perform correctly. 而且看起来cmake不能正确执行。 But I don't get any idea on how to fix it. 但是我对如何解决它一无所知。

I installed libpng successfully following the steps from that answer just now.I don't think you installed it correctly because I once saw these results when I installed incorrectly. 我刚刚按照该答案中的步骤成功安装了libpng。我认为您没有正确安装它,因为一旦我安装不正确,我就会看到这些结果。

-- Performing Test HAVE_LD_VERSION_SCRIPT -执行测试HAVE_LD_VERSION_SCRIPT

-- Performing Test HAVE_LD_VERSION_SCRIPT - Failed -执行测试HAVE_LD_VERSION_SCRIPT-失败

-- Performing Test HAVE_SOLARIS_LD_VERSION_SCRIPT -执行测试HAVE_SOLARIS_LD_VERSION_SCRIPT

-- Performing Test HAVE_SOLARIS_LD_VERSION_SCRIPT - Failed -执行测试HAVE_SOLARIS_LD_VERSION_SCRIPT-失败

Afterwards, I found that I made mistakes in choosing CMAKE_INSTALL_PREFIX and libzip's CMAKE_PREFIX_PATH. 之后,我发现选择CMAKE_INSTALL_PREFIX和libzip的CMAKE_PREFIX_PATH时出错。 Just remind that zlib and libzip should be installed in the same path. 请注意,zlib和libzip应该安装在同一路径中。 And libpng should be installed in an identical path to the previous one. 并且libpng应该安装在与前一个路径相同的路径中。

Are you sure you selected the correct generator with CMake ? 您确定使用CMake选择了正确的生成器吗? As far as I know you need to pick "Visual Studio 14 2015 Win64" as target name if you want to build 64 bit binaries. 据我所知,如果要构建64位二进制文​​件,则需要选择“ Visual Studio 14 2015 Win64”作为目标名称。

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

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