0

i have problem when replace fixed libpng. i used cocos2d1.0.1-x-0.13.0-beta/ndkr8

Compile++ thumb : cocos2dx_static <= CCFileUtils.cpp
Compile++ thumb : cocos2dx_static <= CCGL.cpp
Compile++ thumb : cocos2dx_static <= CCImage.cpp
C:/Users/trach/Pictures/cocos2d-1.0.1-x-0.13.0-beta/cocos2dx/platform/CCImage.cpp: In member function 'bool cocos2d::CCImage::_initWithPngData(void, int)':
C:/Users/trach/Pictures/cocos2d-1.0.1-x-0.13.0-beta/cocos2dx/platform/CCImage.cpp:257:33: error: invalid use of incomplete type 'png_info {aka struct png_info_def}'
C:/Users/trach/Pictures/cocos2d-1.0.1-x-0.13.0-beta/cocos2dx/platform/third_party/android/prebuilt/libpng/include/png.h:594:16: error: forward declaration of 'png_info {aka struct png_info_def}'
make: ** [/cygdrive/c/Users/trach/Pictures/android-ndk-r8e/build/core/build-binary.mk:273: obj/local/armeabi/objs/cocos2dx_static/platform/CCImage.o] Error 1
make: Leaving directory '/cygdrive/c/Users/trach/Pictures/cocos2d-1.0.1-x-0.13.0-beta/show_entry'
cp: cannot create regular file '/cygdrive/c/Users/trach/Pictures/cocos2d-1.0.1-x-0.13.0-beta/show_entry/jni/../libs/armeabi': No such file or directory
Lão Tà
  • 78
  • 1
  • 9

1 Answers1

0

libpng-1.5 and later do not allow direct access to the members of png_ptr, so you have to replace things like

png_info->width
png_ptr->width

with things like

png_get_image_width(png_ptr,png_info)

in your application, or downgrade libpng to the latest 1.2.x version.

Glenn Randers-Pehrson
  • 11,940
  • 3
  • 37
  • 61