Note that there are some explanatory texts on larger screens.

plurals
  1. POBoost with box2d
    text
    copied!<p>I'm trying to use boost in my box2d game. But when I'm creating b2world, boost crashes.</p> <pre><code>#include &lt;Box2d/Box2D.h&gt; #include &lt;boost/filesystem/operations.hpp&gt; #include &lt;boost/filesystem/path.hpp&gt; namespace fs = boost::filesystem; int main(int argc, char *argv[]) { b2World *world = new b2World(b2Vec2(0.0f, -10.0f), true); fs::path full_path(fs::initial_path&lt;fs::path&gt;()); delete world; return 0; } </code></pre> <p>When I comment string with box2d or boost code, it works ok. But they don't want work together. </p> <p>Error: Unhandled exception at 0x5d9031ea (msvcr90d.dll) in Game.exe: 0xC0000005: Access violation reading location 0xccccccc0.</p> <pre><code>&gt; msvcr90d.dll!operator delete(void * pUserData=0xcccccccc) Line 52 + 0x3 bytes C++ msvcp90d.dll!std::allocator&lt;unsigned short&gt;::deallocate(unsigned short * _Ptr=0xcccccccc, unsigned int __formal=3435973837) Line 146 + 0x9 bytes C++ msvcp90d.dll!std::basic_string&lt;unsigned short,std::char_traits&lt;unsigned short&gt;,std::allocator&lt;unsigned short&gt; &gt;::_Tidy(bool _Built=true, unsigned int _Newsize=0) Line 2168 C++ msvcp90d.dll!std::basic_string&lt;unsigned short,std::char_traits&lt;unsigned short&gt;,std::allocator&lt;unsigned short&gt; &gt;::~basic_string&lt;unsigned short,std::char_traits&lt;unsigned short&gt;,std::allocator&lt;unsigned short&gt; &gt;() Line 917 C++ Game.exe!boost::filesystem3::path::~path() + 0x2e bytes C++ Game.exe!main(int argc=1, char * * argv=0x003a4ca0) Line 32 + 0x19 bytes C++ Game.exe!__tmainCRTStartup() Line 582 + 0x19 bytes C </code></pre> <p>Produces only in debug mode.</p> <p>It doesn't matter where I create b2World object: after full_path() or not. Error produces even I create b2World object in another class or file in project.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload