I'm trying to use ChaiScript with SFML for my game engine. All the SFML stuff works fine, until I include chaiscript.hpp
in my game object header file. My GameObject header file looks a little like this:
#include <a bunch of standard libraries>
#include "imgui.h"
struct Object {
std::string name;
void init();
void update();
void render();
*some template functions*
};
The problem occurs when I try to include chaiscript.hpp
in the above file. I get a repeating error (8 of them, to be exact) from SFML's Rect.inl file: '(': illegal token on right side of '::'
, and then no other errors. It compiles fine when I don't include chaiscript.hpp
, or when I include chaiscript.hpp
in the object cpp file. I've used ChaiScript before with SDL and never had an issue like this, so is it an SFML macro messing something up? How can I avoid this problem?
It sounds like something in ChaiScript is messing up something in SFML. Reversing the order that you include them may remove those errors (include SFML before ChaiScript, or vice versa).