Also I just found that if I comment out the fp.h it works fine on the simulator but on the device i get the following error
[Code from texture test2d to load a png using libpng added to CCTExtureCache addImage for png files] Error happens on last line of code, shown after code segment
-(CCTexture2D*) addPNGImage: (NSString*) newName
{
#define PNG_SIG_BYTES 8
//Load png
png_uint_32 width, height, width2, height2;
int bits = 0;
FILE *png_file = fopen([newName UTF8String], "rb");
NSAssert(png_file, @"PNG doesn't exists");
uint8_t header[PNG_SIG_BYTES];
fread(header, 1, PNG_SIG_BYTES, png_file);
NSAssert(!png_sig_cmp(header, 0, PNG_SIG_BYTES), @"Unkonw file format");
png_structp png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
NSAssert(png_ptr, @"No mem");
png_infop info_ptr = png_create_info_struct(png_ptr);
NSAssert(info_ptr, @"No mem");
png_infop end_info = png_create_info_struct(png_ptr);
NSAssert(end_info, @"No mem");
NSAssert(!setjmp(png_jmpbuf(png_ptr)), @"setjmp error");
The above assert fails. I have no idea what its trying to do but it works on the simulator and not the device here. Using 3.1 if that matters.