Can't compile libpng 1.6 on windows via cmake:

2019-09-03 19:03发布

VS 2015 Update 1. Prebuilt zlib is extracted into project/zlib. find_package finds it alright with proper vars supplied. It adds the dir as include in cl invocation: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64\CL.exe /c /IC:\project\zlib\include /IC:\project\libpng /nologo /W3 /WX- /O2 /Ob2 /D WIN32 /D _WINDOWS /D NDEBUG /D _CRT_SECURE_NO_DEPRECATE /D "CMAKE_INTDIR=\"Release\"" /D _MBCS /Gm- /MD /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"png16_static.dir\Release\\" /Fd"png16_static.dir\Release\png16_static.pdb" /Gd /TC /errorReport:queue C:\project\libpng\png.c C:\project\libpng\pngerror.c C:\project\libpng\pngget.c C:\project\libpng\pngmem.c C:\project\libpng\pngpread.c C:\project\libpng\pngread.c C:\project\libpng\pngrio.c C:\project\libpng\pngrtran.c C:\project\libpng\pngrutil.c C:\project\libpng\pngset.c C:\project\libpng\pngtrans.c C:\project\libpng\pngwio.c C:\project\libpng\pngwrite.c C:\project\libpng\pngwtran.c C:\project\libpng\pngwutil.c

but it fails during compilation with:

c:\project\libpng\pngstruct.h(30): fatal error C1083: Cannot open include file: 'zlib.h': No such file or directory and etc.

Can't see what's could be wrong. There is definitely zlib.h inside C:\project\zlib\include

1条回答
Root(大扎)
2楼-- · 2019-09-03 19:39

I can't believe how stupid the reason was. The problem was that on CI zlib contents got extracted into one extra zlib folder (so it was zlib/zlib) since archive already contained zlib folder.

查看更多
登录 后发表回答