Compiling Panda3D / Rocket with Visual Studio 2010

Hey !

I’m having issues compiling a project on Windows, when using Visual Studio 2010.
The bug is a name conflict between two classes ‘Factory’ from Panda3D and Rocket. The classes are different, and gcc can tell the difference, but msvc doesn’t.

The solution my mate took was to search/replace all occurences of the Factory class to RFactory in in the Rocket lib.
But I can’t imagine everyone having to do that before compiling the project.

I suppose I’m not the only one who had this problem with MSVC2010.
If someone had it and found the proper way to fix it, I would love to hear about it !

hi
i need help in c++
any expert here
i will pay for that :question:

The solution I found was to put this around the <Rocket/Core.h> include line in config_rocket.cxx:

#define Factory RocketFactory
#include <Rocket/Core.h>
#undef Factory

I’ve checked this change in to CVS.

For the record, I’m pretty close to finishing porting Panda to VC 2010 for good; I’ll be checking in my work soon and will then start changing the buildbots to output VC 2010 builds.
EDIT: done. viewtopic.php?f=9&t=16346

Sweet ! That’s a quick and easy way to fix that !
Good job on the MSVC2010 port ! I’ll be rocking it as soon as I get a new Windows up and running !

EDIT: for those who will fall on this topic, this means that if you wish to directly use the Rocket::Core::Factory class, you mustn’t do it in a file that includes the p3rocket header.