I have quickly integrated Box2D (2.0.1) into our engine, but I can't get it to compile when I put all my box2 headers in a namespace.
If I simply include everything at a global level, everything compiles, links and runs fine.
But when I wrap it in a namespace I get some STD compile errors. I'm not overly familar with these particular includes that box2D uses, but more importantly, I'm not sure why these types aren't resolving. If it was use of the types inside the Box2D I wouldn't be so fussed, and change the box2d code to use the :: (global) namespace.
And the subsequent errors;
I'm compiling with Visual C++ Express 2008 (9.0.030729.1 SP). I've not tried gcc/g++ or the other platforms we support yet, but I need to get this to compile regardless 🙂
After a search I read in the forums about requiring a service pack for a much older version of visual studio, so later I'll make sure I've got the latest version, latest platform sdk etc etc
but if someone can point me in the right direction or know the problem that would be great 🙂
If I simply include everything at a global level, everything compiles, links and runs fine.
Code:
#include <box2d/include/box2d.h>
But when I wrap it in a namespace I get some STD compile errors. I'm not overly familar with these particular includes that box2D uses, but more importantly, I'm not sure why these types aren't resolving. If it was use of the types inside the Box2D I wouldn't be so fussed, and change the box2d code to use the :: (global) namespace.
Code:
namespace Box2D
{
#include <box2d/include/box2d.h>
}
{
#include <box2d/include/box2d.h>
}
And the subsequent errors;
Code:
c:\program files\microsoft visual studio 9.0\vc\include\cwchar(27) : error C2039: 'mbstate_t' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 9.0\vc\include\cwchar(27) : error C2873: 'mbstate_t' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 9.0\vc\include\cwchar(28) : error C2039: 'tm' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 9.0\vc\include\cwchar(28) : error C2873: 'tm' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 9.0\vc\include\cwchar(31) : error C2039: 'btowc' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 9.0\vc\include\cwchar(31) : error C2873: 'btowc' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 9.0\vc\include\cwchar(32) : error C2039: 'fwide' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 9.0\vc\include\cwchar(32) : error C2873: 'fwide' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 9.0\vc\include\cwchar(34) : error C2039: 'mbrlen' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 9.0\vc\include\cwchar(34) : error C2873: 'mbrlen' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 9.0\vc\include\cwchar(34) : error C2039: 'mbrtowc' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 9.0\vc\include\cwchar(34) : error C2873: 'mbrtowc' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 9.0\vc\include\cwchar(34) : error C2039: 'mbsrtowcs' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 9.0\vc\include\cwchar(34) : error C2873: 'mbsrtowcs' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 9.0\vc\include\cwchar(35) : error C2039: 'mbsinit' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 9.0\vc\include\cwchar(35) : error C2873: 'mbsinit' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 9.0\vc\include\cwchar(27) : error C2873: 'mbstate_t' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 9.0\vc\include\cwchar(28) : error C2039: 'tm' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 9.0\vc\include\cwchar(28) : error C2873: 'tm' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 9.0\vc\include\cwchar(31) : error C2039: 'btowc' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 9.0\vc\include\cwchar(31) : error C2873: 'btowc' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 9.0\vc\include\cwchar(32) : error C2039: 'fwide' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 9.0\vc\include\cwchar(32) : error C2873: 'fwide' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 9.0\vc\include\cwchar(34) : error C2039: 'mbrlen' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 9.0\vc\include\cwchar(34) : error C2873: 'mbrlen' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 9.0\vc\include\cwchar(34) : error C2039: 'mbrtowc' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 9.0\vc\include\cwchar(34) : error C2873: 'mbrtowc' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 9.0\vc\include\cwchar(34) : error C2039: 'mbsrtowcs' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 9.0\vc\include\cwchar(34) : error C2873: 'mbsrtowcs' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 9.0\vc\include\cwchar(35) : error C2039: 'mbsinit' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 9.0\vc\include\cwchar(35) : error C2873: 'mbsinit' : symbol cannot be used in a using-declaration
I'm compiling with Visual C++ Express 2008 (9.0.030729.1 SP). I've not tried gcc/g++ or the other platforms we support yet, but I need to get this to compile regardless 🙂
After a search I read in the forums about requiring a service pack for a much older version of visual studio, so later I'll make sure I've got the latest version, latest platform sdk etc etc
but if someone can point me in the right direction or know the problem that would be great 🙂