invoke FNTConfigLoadFile, FNTConfigRemoveCache then link error.

invoke FNTConfigLoadFile, FNTConfigRemoveCache then link error.
0.0 0


win32 platform.
Open the cocos2d-win32.vc2008.sln and invoke either of the two funtion will cause error LNK2019 in Visual Studio.
I add FNTConfigRemoveCache() in labelTest.cpp of the test project or HelloWorld. It link failed.

error LNK2019: unresolved external symbol “void __cdecl cocos2d::FNTConfigRemoveCache(void)” (?FNTConfigRemoveCache@cocos2d@@YAXXZ)…….

I’m not sure it’s only happen on my computer, or something wrong.


On win32 & android, cocos2d-x is built as a dynamic library, while these function FNTCOnfigRemoveCache & FNTConfigLoadFile haven’t been export.
Adding CC_DLL to the declaration of these functions will fix the bug.

/** Free function that parses a FNT file a place it on the cache
CC_DLL CCBMFontConfiguration * FNTConfigLoadFile( const char *file );

/** Purges the FNT config cache
CC_DLL void FNTConfigRemoveCache( void );


Thanks, Walzer Wang! It works.


I just check this problem now, CC_DLL is added into these 2 methods in the edge version, it will be publish in the next version. @hewen xie, thanks to your report again.