obj/Debug/LevelLoader.o||In function `LevelLoader::LoadLevel(std::vector<Block, std::allocator<Block> >&, std::string)':|
/usr/include/c++/4.7/bits/vector.tcc|397|multiple definition of `LevelLoader::LoaderException'|
I found way around this, but I would like to know why it shows multiple declarations.
My solution is to declare this class in function body(void LoadLevel()), just before the throw statement. But why can't I define it inside my namespace, but outside function?
@kbw - I don't really know. It works fine the way it is, just class definition was forbidden there, and that's what I'm asking for. I'm using this pattern(so I just change class name and returned string) for few other objects, no complains and works as expected, but these were defined in other class body.
@Mikey - No. Okay, that explained it, I guess. So if I included LevelLoader.hpp in both LevelLoader.cpp and Level.hpp(some other header file), then it counts as creating this object twice, hence giving error?