Help! Error: expected initializer before 'OF'

I’m getting the error message “error: expected initializer before ‘OF’” when I try to compile cocos2dx. I can’t seem to figure out why it would be throwing this error. Any help would be great. Thanks!
when i running ./make-all-linux-project.sh
I get
@
g++ WallfPIC g3O0 ~~I…~~I…/platform/third_party/linux/libfreetype2 I…/cocoaI…/include I…/kazmath/includeI…/…/extensions I…/…/extensions/CCBReaderI…/…/extensions/GUI/CCControlExtension I…/…/extensions/GUI/CCControlExtensionI…/…/external/chipmunk/include/chipmunk I…/…/extensions/networkI…/platform/linux I…/platform/third_party/linux/libxml2I…/platform/third_party/linux/libpng I…/platform/third_party/linux/libjpegI…/platform/third_party/linux/libtiff/include I/platform/third_party/linux/include64DLINUX ~~DCC_PLATFORM_FILEUTILS_CPP~~DCC_PLATFORM_IMAGE_CPP DDEBUGDCC_ENABLE_CHIPMUNK_INTEGRATION DCOCOS2D_DEBUG=1c …/platform/linux/CCFileUtils.cpp -o …/platform/linux/CCFileUtils.o
…/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/harrison/Dev/cocos2d-2.1beta3-x-2.1.1/cocos2dx/proj.linux’
@

hi,

It can be caused by missing definition of the macro “OF” (maybe your /usr/include/zlib.h defined "Z_OF" but no “OF”).
I solved this by:
<pre>
// insert these lines into cocos2dx/support/zip_support/ioapi.h:124 and cocos2dx/support/zip_support/unzip.h:82.
#ifndef OF
#defineOF_DEFINED_BY_ME
#ifdef STDC
#define OF (args) args
#else
#define OF (args)
#endif
#endif
// append these lines to the end of cocos2dx/support/zip_support/ioapi.cpp and cocos2dx/support/zip_support/unzip.cpp.
// these seem necessary, but dunno why.
#ifdef
OF_DEFINED_BY_ME
#undef OF
#undef
_OF_DEFINED_BY_ME
#endif

Good luck.