Bug(ish) @ CCLayerGradient

Bug(ish) @ CCLayerGradient
0.0 0


First off, happy new Chinese year! :smiley:

Anyway, I’ve found another bug :slight_smile: This time, it was an easy one:

  • Open $cocos2dx_root/cocos2dx/include/CCLayer.h
  • Look for the CCLayerGradient class

As you might notice, there’s no DLL declaration thingy in there! So whenever one uses CCLayerGradient on Win32, the linker will complain because it cannot find the class. It’s easily fixed by adding the CCX_DLL macro in front of the CCLayerGradient class declaration.


…and the CCTimer class (see CCScheduler.h) needs one such addition as well to work on Win32 :slight_smile:

Edit: woops, forget about that. Didn’t see the comments about CCTimer yet (about it being deprecated).


Thx! I will fix them after the holiday. It’s family time in these days, hehe


It’s fixed at https://github.com/cocos2d/cocos2d-x/commit/344711a5cf9d53015d89e303d34bc819f4be141e
Thanks again for all of you!


Found another one:

There’s this class called CCFileUtils, which derives from FileUtils. However, if you’d like to use getFileData or getFileDataFromZip, that’s not an option because only CCFileUtils has the CCX_DLL macro and FileUtils not.

Adding CCX_DLL to FileUtils ($cocos2dx_root/cocos2dx/include/FileUtils.h) fixes the issue.