Note that there are some explanatory texts on larger screens.

plurals
  1. POc++ game exe stopped working, lot of class. Working in visual c++
    primarykey
    data
    text
    <p>Hi it's been some weeks Im developping a game for a contest. (I am familiar with coding a little, but not a lot).</p> <p>I'm writing the game with visual c++. When I run it in release mode on Visual c++, it runs ok, but when I try from the .exe, a window pops-up and say "<em>*</em>*.exe has stopped working". I know what does the error but I don't know how to fix it. The error pops-up because there is a lot of vectors, If I delete some vectors resizing from the program the game runs, it can be anyting, a wall, a box vector, it doesn't matter. But I find it really strange because when I look up in the task manager the games only takes up 20,000K of Memory.</p> <p>So in conclusion, if I delete some vectors from the game, the game exe runs, if not, it will only run in visual c++. What should I do? I'm really lost.</p> <p>//////////////////////////////////////////////////////////////////////////////////</p> <p>OK if I resize only four vector list, the .exe will run, but if I resize more than 4, the exe will give an error, but the visual c++ instance still runs.</p> <pre><code>class Level { public: int LevelWidth; MapElements::Background Background; //OBJETS SUR MAP Array&lt;MapElements::Ground&gt; Grounds; Array&lt;MapElements::Wall&gt; Walls; Array&lt;MapElements::Platform&gt; Platforms; Array&lt;MapElements::Box&gt; Boxs; //ENNEMIS et JOUEUR Array&lt;Gameplay::Droite&gt; Droites; Array&lt;Gameplay::Cercle&gt; Cercles; Gameplay::Player Player; }; </code></pre> <p>this works:</p> <pre><code> void Level::InitializeMap(int MaxGround, int MaxWall, int MaxPlatforms, int MaxBox) { Grounds.Element.resize(MaxGround); Walls.Element.resize(MaxWall); Platforms.Element.resize(MaxPlatforms); Boxs.Element.resize(MaxBox); } </code></pre> <p>this doesn't:</p> <pre><code> void Level::InitializeMap(int MaxGround, int MaxWall, int MaxPlatforms, int MaxBox, int MaxCercles) { Grounds.Element.resize(MaxGround); Walls.Element.resize(MaxWall); Platforms.Element.resize(MaxPlatforms); Boxs.Element.resize(MaxBox); Cercles.Element.resize(MaxCercles); } </code></pre> <p>the Array class:</p> <pre><code>template &lt;typename T&gt; class Array { public: std::vector&lt;T&gt; Element; Array(); }; template &lt;typename T&gt; Array&lt;T&gt;::Array() { } </code></pre> <p>The resizing works if I only have 4 vector.resize(), and it can be any of the variables (wall, box, etc), what is the source of the error?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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