Error about zlib when I build cocos2d-x on Gentoo Linux?

Hello all,

I always like to use Gentoo, so I want to build cocos2d-x on Gentoo. But I’m troubled by the following Errors.

Hope any helps, thanks.

B.R
Kermit

…/platform/linux/CCFileUtils.cpp:9:0: warning: “CC_PLATFORM_FILEUTILS_CPP” redefined [enabled by default]
:0:0: note: this is the location of the previous definition
In file included from …/support/zip_support/unzip.h:51:0,
from …/platform/CCFileUtilsCommon_cpp.h:36,
from …/platform/linux/CCFileUtils.cpp:10:
…/support/zip_support/ioapi.h:126:51: error: expected initializer before ‘OF’
…/support/zip_support/ioapi.h:127:51: error: expected initializer before ‘OF’
…/support/zip_support/ioapi.h:128:51: error: expected initializer before ‘OF’
…/support/zip_support/ioapi.h:129:51: error: expected initializer before ‘OF’
…/support/zip_support/ioapi.h:130:51: error: expected initializer before ‘OF’
…/support/zip_support/ioapi.h:132:51: error: expected initializer before ‘OF’
…/support/zip_support/ioapi.h:133:51: error: expected initializer before ‘OF’
…/support/zip_support/ioapi.h:139:5: error: ‘open_file_func’ does not name a type
…/support/zip_support/ioapi.h:140:5: error: ‘read_file_func’ does not name a type
…/support/zip_support/ioapi.h:141:5: error: ‘write_file_func’ does not name a type
…/support/zip_support/ioapi.h:142:5: error: ‘tell_file_func’ does not name a type
…/support/zip_support/ioapi.h:143:5: error: ‘seek_file_func’ does not name a type
…/support/zip_support/ioapi.h:144:5: error: ‘close_file_func’ does not name a type
…/support/zip_support/ioapi.h:145:5: error: ‘testerror_file_func’ does not name a type
…/support/zip_support/ioapi.h:149:51: error: expected initializer before ‘OF’
…/support/zip_support/ioapi.h:150:51: error: expected initializer before ‘OF’
…/support/zip_support/ioapi.h:151:51: error: expected initializer before ‘OF’
…/support/zip_support/ioapi.h:155:5: error: ‘open64_file_func’ does not name a type
…/support/zip_support/ioapi.h:156:5: error: ‘read_file_func’ does not name a type
…/support/zip_support/ioapi.h:157:5: error: ‘write_file_func’ does not name a type
…/support/zip_support/ioapi.h:158:5: error: ‘tell64_file_func’ does not name a type
…/support/zip_support/ioapi.h:159:5: error: ‘seek64_file_func’ does not name a type
…/support/zip_support/ioapi.h:160:5: error: ‘close_file_func’ does not name a type
…/support/zip_support/ioapi.h:161:5: error: ‘testerror_file_func’ does not name a type
…/support/zip_support/ioapi.h:165:28: error: expected initializer before ‘OF’
…/support/zip_support/ioapi.h:166:26: error: expected initializer before ‘OF’
…/support/zip_support/ioapi.h:172:5: error: ‘open_file_func’ does not name a type
…/support/zip_support/ioapi.h:173:5: error: ‘tell_file_func’ does not name a type
…/support/zip_support/ioapi.h:174:5: error: ‘seek_file_func’ does not name a type
…/support/zip_support/ioapi.h:185:21: error: expected initializer before ‘OF’
…/support/zip_support/ioapi.h:186:22: error: expected initializer before ‘OF’
…/support/zip_support/ioapi.h:187:23: error: expected initializer before ‘OF’
In file included from …/platform/CCFileUtilsCommon_cpp.h:36:0,
from …/platform/linux/CCFileUtils.cpp:10:
…/support/zip_support/unzip.h:151:38: error: expected initializer before ‘OF’
…/support/zip_support/unzip.h:164:25: error: expected initializer before ‘OF’
…/support/zip_support/unzip.h:165:27: error: expected initializer before ‘OF’
…/support/zip_support/unzip.h:182:26: error: expected initializer before ‘OF’
…/support/zip_support/unzip.h:189:29: error: expected initializer before ‘OF’
…/support/zip_support/unzip.h:196:22: error: expected initializer before ‘OF’
…/support/zip_support/unzip.h:203:30: error: expected initializer before ‘OF’
…/support/zip_support/unzip.h:206:32: error: expected initializer before ‘OF’
…/support/zip_support/unzip.h:214:33: error: expected initializer before ‘OF’
…/support/zip_support/unzip.h:227:30: error: expected initializer before ‘OF’
…/support/zip_support/unzip.h:234:32: error: expected initializer before ‘OF’
…/support/zip_support/unzip.h:244:29: error: expected initializer before ‘OF’
…/support/zip_support/unzip.h:251:31: error: expected initializer before ‘OF’
…/support/zip_support/unzip.h:262:27: error: expected initializer before ‘OF’
…/support/zip_support/unzip.h:308:37: error: expected initializer before ‘OF’
…/support/zip_support/unzip.h:317:35: error: expected initializer before ‘OF’
…/support/zip_support/unzip.h:341:48: error: expected initializer before ‘OF’
…/support/zip_support/unzip.h:351:32: error: expected initializer before ‘OF’
…/support/zip_support/unzip.h:357:40: error: expected initializer before ‘OF’
…/support/zip_support/unzip.h:365:33: error: expected initializer before ‘OF’
…/support/zip_support/unzip.h:378:33: error: expected initializer before ‘OF’
…/support/zip_support/unzip.h:393:33: error: expected initializer before ‘OF’
…/support/zip_support/unzip.h:399:32: error: expected initializer before ‘OF’
…/support/zip_support/unzip.h:413:25: error: expected initializer before ‘OF’
…/support/zip_support/unzip.h:415:28: error: expected initializer before ‘OF’
…/support/zip_support/unzip.h:420:20: error: expected initializer before ‘OF’
…/support/zip_support/unzip.h:425:35: error: expected initializer before ‘OF’
In file included from …/platform/linux/CCFileUtils.cpp:10:0:
…/platform/CCFileUtilsCommon_cpp.h: In member function ‘unsigned char* cocos2d::CCFileUtils::getFileDataFromZip(const char**, const char**, long unsigned int**)’:
…/platform/CCFileUtilsCommon_cpp.h:344:39: error: ‘unzOpen’ was not declared in this scope
…/platform/CCFileUtilsCommon_cpp.h:347:55: error: ‘unzLocateFile’ was not declared in this scope
…/platform/CCFileUtilsCommon_cpp.h:352:106: error: ‘unzGetCurrentFileInfo’ was not declared in this scope
…/platform/CCFileUtilsCommon_cpp.h:355:40: error: ‘unzOpenCurrentFile’ was not declared in this scope
…/platform/CCFileUtilsCommon_cpp.h:360:78: error: ‘unzReadCurrentFile’ was not declared in this scope
…/platform/CCFileUtilsCommon_cpp.h:364:34: error: ‘unzCloseCurrentFile’ was not declared in this scope
…/platform/CCFileUtilsCommon_cpp.h:369:23: error: ‘unzClose’ was not declared in this scope
make:**** […/platform/linux/CCFileUtils.o] Error 1
make: Leaving directory `/home/kermit/Project/cocos2d-x/cocos2dx/proj.linux’

I had solved that, and it’s not an error about zlib in cocos2D, but something modified by Gentoo.
Just add the following code into cocos2dx/support/zip_support/ioapi.h:

#ifndef OF
#define OF (x) _Z_OF(x)
#endif

Sorry to trouble others.

B.R
Kermit