【问题标题】:Error in installing libpng for windows x64为 windows x64 安装 libpng 时出错
【发布时间】:2017-03-04 04:23:15
【问题描述】:

我尝试从http://libpng.org/pub/png/libpng.html 安装并重新安装libpng。我需要这个来使用bob(由python托管)进行面部验证。我按照第一步从this answer 安装libzipziplib。但是我不断收到错误。

这里我列出来自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

然后,这是我在构建时得到的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

据我所知,我应该处理的是 x64 版本。而且看起来cmake 执行不正确。但我不知道如何解决它。

【问题讨论】:

    标签: python visual-studio libpng


    【解决方案1】:

    您确定使用 CMake 选择了正确的生成器吗?据我所知,如果要构建 64 位二进制文​​件,则需要选择“Visual Studio 14 2015 Win64”作为目标名称。

    【讨论】:

      【解决方案2】:

      我按照刚才那个答案的步骤成功安装了libpng。我认为你没有正确安装它,因为我曾经在安装不正确时看到这些结果。

      -- 执行测试HAVE_LD_VERSION_SCRIPT

      -- 执行测试 HAVE_LD_VERSION_SCRIPT - 失败

      -- 执行测试HAVE_SOLARIS_LD_VERSION_SCRIPT

      -- 执行测试 HAVE_SOLARIS_LD_VERSION_SCRIPT - 失败

      后来发现我在选择CMAKE_INSTALL_PREFIX和libzip的CMAKE_PREFIX_PATH时出错了。只是提醒一下 zlib 和 libzip 应该安装在同一路径中。并且 libpng 应该安装在与前一个相同的路径中。

      【讨论】:

        猜你喜欢
        • 2016-09-10
        • 2020-08-07
        • 1970-01-01
        • 2023-02-16
        • 1970-01-01
        • 1970-01-01
        • 2013-07-10
        • 2014-12-18
        • 2019-01-20
        相关资源
        最近更新 更多