Web lists-archives.com

[Mingw-users] Using mingw's libpng?




Are there some special command line switches needed to build a program 
with the libpng dll in mingw?

Using this test program:

   http://zarb.org/~gc/resource/libpng-short-example.c

on a Centos box:

gcc -o png-test libpng-short-example.c -lpng -lz -lm
./png-test testcase.png foo.png

and the program ran.  It dumps the data pixel by pixel and copies the 
image
from the first to the 2nd file.

However on Mingw with the same compile line and input data it does:

$ ./png-test testcase.png killme.png

This application has requested the Runtime to terminate it in an unusual 
way.
Please contact the application's support team for more information.
libpng error: invalid after png_start_read_image or png_read_update_info
[read_png_file] Error during read_image

This was done on two Mingw systems, an old XP one with a years old 
Mingw, and a Windows 7 that was installed a month or so ago with the 
current Mingw.  Both behaved exactly the same way.  They also did the 
same thing with "-lpng16" instead of "-lpng".

This inquiry started when a much more complex program was crashing at
   png_write_info()

which led to

   
http://stackoverflow.com/questions/34309014/libpng-crashes-on-png-write-into-windows-10-vs2013-self-built-all-tests-pass

which in turn led to this:

   
http://stackoverflow.com/questions/22774265/libpng-crashes-on-png-read-info

Is there maybe a similar issue here?  What flags were used when libpng 
was compiled?

Inkscape builds in this environment, and its png works, but it is worth 
noting that it uses a different libpng, from its own devlibs package, 
not the one that comes with Mingw.

Thanks,

David Mathog
mathog@xxxxxxxxxxx
Manager, Sequence Analysis Facility, Biology Division, Caltech

------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
MinGW-users mailing list
MinGW-users@xxxxxxxxxxxxxxxxxxxxx

This list observes the Etiquette found at 
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:mingw-users-request@xxxxxxxxxxxxxxxxxxxxx?subject=unsubscribe