A Simple Mac OS X libpng Example with OpenGL
Subject:   Type Conversion Compilation Problems
Date:   2007-01-25 11:23:41
From:   Stuey
When I added these pngLoad files to my project I got some compilation errors related to type conversions. In function 'int pngLoad(char*, long unsigned int**, long unsigned int**, char**)': error: invalid conversion from 'unsigned char*' to 'char*' warning: comparison between signed and unsigned integer expressions error: invalid conversion from 'char*' to 'png_byte*'
make: *** [pngLoad.o] Error 1
make: Target `first' not remade because of errors.

I fixed these by changing the typecast from (unsigned char*) to just (char *). And adding a typecast (png_byte*) on line 146.

But I wonder why this code would work for some people? I suppose it must be a different compiler?

I'm using: