CCSAXParser : link errors on win32


#1

Hi,

I’m trying to use CCSAXParser in cocos2d-x. I’m currently building for win32.
When I simply instanciate a CCSAXParser object (with something as simple as “CCSAXParser parser;”), I get link errors:
The linker can’t find it:
1>Game1.obj : error LNK2001: unresolved external symbol “public: *thiscall cocos2d::CCSAXParser::~CCSAXParser"
1>Game1.obj : error LNK2001: unresolved external symbol "public:*thiscall cocos2d::CCSAXParser::CCSAXParser(void)” (??0CCSAXParser@cocos2d@QAEXZ)

I really don’t understand why because I double checked that the library compiles CCSAXParser.cpp (I tested to put a compile error in it) and that I properly link to the lib I am building (simple remove the .lib to check).

Anyone had similar problem? Any ideas?
I have this problem in Debug and Release builds.


#2

I found out that the class was voluntarily not exported. So I added CC_DLL in the class definition and now I can use it!