简体   繁体   中英

Error in installing libpng for windows x64

I'd tried install and reinstall libpng from http://libpng.org/pub/png/libpng.html . I need this to use for face verification using bob (hosted by python ). I'd followed the first step by installing libzip and ziplib from this answer . However I keep getting error.

Here I list the result from 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 :

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. And also it looks like cmake does not perform correctly. 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.

-- 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

Afterwards, I found that I made mistakes in choosing CMAKE_INSTALL_PREFIX and libzip's CMAKE_PREFIX_PATH. Just remind that zlib and libzip should be installed in the same path. And libpng should be installed in an identical path to the previous one.

Are you sure you selected the correct generator with 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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