Menu

#262 libpng 1.6.28 Error building in VS2015 x64

libpng_code
open
None
5
2017-08-21
2017-01-31
Maxim S
No

It looks like there is an error when trying to build libpng with VS2015. This happens if we try to create it with NMake or VS.

To replicate this error you need to open CMakeLists in cmake,
select Visual Studio 14 2015 Win64 as the project. Configure and Generate.

After opening the created project in VS and running Build I get the following:

3>  Building Custom Rule D:/Development/TheConstructExt/ExtSrc/lpng1628/CMakeLists.txt
3>  CMake does not need to re-run because D:\Development\TheConstructExt\ExtSrc\lpng1628\CMakeFiles\generate.stamp is up-to-date.
3>  Generating pnglibconf.c
3>  gawk: D:/Development/TheConstructExt/ExtSrc/lpng1628/scripts/options.awk:169: (FILENAME=D:/Development/TheConstructExt/ExtSrc/lpng1628/scripts/pnglibconf.dfa FNR=891) fatal: cannot open file `D:/Development/TheConstructExt/ExtSrc/lpng1628/pngusr.dfa' for reading (No such file or directory)
3>
3>  CMake Error at scripts/gensrc.cmake:60 (message):
3>    Failed to generate pnglibconf.tf4
3>
3>
3>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(171,5): error MSB6006: "cmd.exe" exited with code 1.

it looks like the file pngusr.dfa is not in the lpng1628 folder at all. Instead it is in folders that are located in lpng1628\contrib\pngminim

Any help from the comunity would be greatly apreciated.

Discussion

  • Glenn Randers-Pehrson

    Don't use the pngusr.dfa in contrib/pngminim; that is an example of building a stripped-down libpng.

     
  • Maxim S

    Maxim S - 2017-01-31

    Right, I figured it was just an example for something. I guess that file
    should be in the root folder, is it missing?
    Or maybe it should be auto generated?

    On Tue, Jan 31, 2017 at 11:46 AM, MAS dieslower@users.sf.net wrote:


    Status: open
    Group: libpng_code
    Created: Tue Jan 31, 2017 04:46 PM UTC by MAS
    Last Updated: Tue Jan 31, 2017 04:46 PM UTC
    Owner: Glenn Randers-Pehrson

    It looks like there is an error when trying to build libpng with VS2015.
    This happens if we try to create it with NMake or VS.

    To replicate this error you need to open CMakeLists in cmake,
    select Visual Studio 14 2015 Win64 as the project. Configure and Generate.

    After opening the created project in VS and running Build I get the
    following:

    3> Building Custom Rule D:/Development/TheConstructExt/ExtSrc/lpng1628/CMakeLists.txt
    3> CMake does not need to re-run because D:\Development\TheConstructExt\ExtSrc\lpng1628\CMakeFiles\generate.stamp is up-to-date.
    3> Generating pnglibconf.c
    3> gawk: D:/Development/TheConstructExt/ExtSrc/lpng1628/scripts/options.awk:169: (FILENAME=D:/Development/TheConstructExt/ExtSrc/lpng1628/scripts/pnglibconf.dfa FNR=891) fatal: cannot open file `D:/Development/TheConstructExt/ExtSrc/lpng1628/pngusr.dfa' for reading (No such file or directory)
    3>
    3> CMake Error at scripts/gensrc.cmake:60 (message):
    3> Failed to generate pnglibconf.tf4
    3>
    3>
    3>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(171,5): error MSB6006: "cmd.exe" exited with code 1.

    it looks like the file pngusr.dfa is not in the lpng1628 folder at all.
    Instead it is in folders that are located in lpng1628\contrib\pngminim

    Any help from the comunity would be greatly apreciated.

    Sent from sourceforge.net because you indicated interest in
    https://sourceforge.net/p/libpng/bugs/262/

    To unsubscribe from further messages, please visit
    https://sourceforge.net/auth/subscriptions/

    --


    Maxim Serebrennik
    Sr Software Enginneer | Leidos

    C (201) 686-8809

     
  • Glenn Randers-Pehrson

    Normally we use the one in the scripts directory (scripts/pnglibconf.dfa)

     
    • Maxim S

      Maxim S - 2017-01-31

      If I copy pnglibconf.dfa to the root folder and rename it to pngusr.dfa I get the following errors:

      9>  Generating pnglibconf.h
      9>  png.c
      9>d:\development\theconstructext\extsrc\lpng1628\pnglibconf.h(229): fatal error C1070: mismatched #if/#endif pair in file 'd:\development\theconstructext\extsrc\lpng1628\pnglibconf.h'
      

      They happen with almost every .c file

       
    • Maxim S

      Maxim S - 2017-01-31

      Also, I just looked at the code base, and it looks like the libpng16 branch has the pngusr.dfa in its root, and the libpng-1.6.28-signed tag does not....
      I tried to build the libpng16 branch just as i did the tag, and the branch built just fine.
      Is there some huge difference between the two?

       

      Last edit: Maxim S 2017-01-31
      • Glenn Randers-Pehrson

        That looks like some mistake in my release script, thanks.

         
        • Maxim S

          Maxim S - 2017-01-31

          No problem! Glad I could help :)

           
  • Glenn Randers-Pehrson

    I'll look into that. But meanwhile, you can try using scripts/pnglibconf.h.prebuilt (just copy it into your build directory and call it pnglibconf.h)

    EDIT: Oh, don't call pnglibconf.dfa pngusr.dfa, pngusr.dfa is your own dfa not the system one.

    So the question isn't why is pngusr.dfa missing, but why is your compiler asking for one?
    As I understand it, the compiler should only look for one if you've configured DFA_EXTRA.

     

    Last edit: Glenn Randers-Pehrson 2017-01-31
    • Maxim S

      Maxim S - 2017-01-31

      Maybe there is some error in the cmake script?
      In the configuration I leave DFZ_EXTRA blank, or whatever the default is.

       

      Last edit: Maxim S 2017-01-31
  • Maxim S

    Maxim S - 2017-01-31

    Glenn,

    If you let me know when you commit the fix, and into which version, I cant test it out to confirm it...

     
    • kibeom youn

      kibeom youn - 2017-03-24

      quick fix. set AWK path as Blank. then CMAKE will use prebuilt header.

       
  • Glenn Randers-Pehrson

    Are you still seeing this problem in libpng-1.6.30?

     
    • Maxim S

      Maxim S - 2017-06-30

      Just did a build and it worked like a charm out of the box!

      What is the difference between 1.6.30 signed and master signed?
      I tried the signed version, not the master....

      On Thu, Jun 29, 2017 at 7:28 AM, Glenn Randers-Pehrson <glennrp@users.sf.net

      wrote:

      Are you still seeing this problem in libpng-1.6.30?

      Status: open
      Group: libpng_code
      Created: Tue Jan 31, 2017 04:46 PM UTC by MAS
      Last Updated: Tue Jan 31, 2017 09:28 PM UTC
      Owner: Glenn Randers-Pehrson

      It looks like there is an error when trying to build libpng with VS2015.
      This happens if we try to create it with NMake or VS.

      To replicate this error you need to open CMakeLists in cmake,
      select Visual Studio 14 2015 Win64 as the project. Configure and Generate.

      After opening the created project in VS and running Build I get the
      following:

      3> Building Custom Rule D:/Development/TheConstructExt/ExtSrc/lpng1628/CMakeLists.txt
      3> CMake does not need to re-run because D:\Development\TheConstructExt\ExtSrc\lpng1628\CMakeFiles\generate.stamp is up-to-date.
      3> Generating pnglibconf.c
      3> gawk: D:/Development/TheConstructExt/ExtSrc/lpng1628/scripts/options.awk:169: (FILENAME=D:/Development/TheConstructExt/ExtSrc/lpng1628/scripts/pnglibconf.dfa FNR=891) fatal: cannot open file `D:/Development/TheConstructExt/ExtSrc/lpng1628/pngusr.dfa' for reading (No such file or directory)
      3>
      3> CMake Error at scripts/gensrc.cmake:60 (message):
      3> Failed to generate pnglibconf.tf4
      3>
      3>
      3>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(171,5): error MSB6006: "cmd.exe" exited with code 1.

      it looks like the file pngusr.dfa is not in the lpng1628 folder at all.
      Instead it is in folders that are located in lpng1628\contrib\pngminim

      Any help from the comunity would be greatly apreciated.

      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/libpng/bugs/262/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

      --


      Maxim Serebrennik
      Sr Software Enginneer | Leidos

      C (201) 686-8809

       
  • Pete Stieber

    Pete Stieber - 2017-08-21

    I'm experiencing the same problem using lpng1631.zip. I worked around it by setting AWK to an empty value as suggested above, but it would be better if this could be skipped in furture versions.

     

Log in to post a comment.

MongoDB Logo MongoDB