Ich habe diese Frage für eine Weile jetzt recherchiert und ich denke, dass ich mein Problem eingegrenzt habe.Kann ntdll.dll nicht laden
Dies ist der Fehlerausgang
Critical error detected c0000374
Duke's Army.exe has triggered a breakpoint.
Exception thrown at 0x77E49841 (ntdll.dll) in Duke's Army.exe: 0xC0000374: A heap has been corrupted (parameters: 0x77E7C8D0).
Unhandled exception at 0x77E49841 (ntdll.dll) in Duke's Army.exe: 0xC0000374: A heap has been corrupted (parameters: 0x77E7C8D0).
The program '[14436] Duke's Army.exe' has exited with code 0 (0x0).
Bezeichnen Sie Stapel als
ucrtbased.dll!0f8aa672() Unknown
[Frames below may be incorrect and/or missing, no symbols loaded for ucrtbased.dll]
[External Code]
> Duke's Army.exe!Tile::Tile() Line 19 C++
[External Code]
Duke's Army.exe!Map::Map(int w, int h) Line 70 C++
Duke's Army.exe!MapGenerator::init(int w, int h) Line 37 C++
Duke's Army.exe!MapGenerator::MapGenerator(int w, int h) Line 13 C++
Duke's Army.exe!PlayGameState::PlayGameState(Game * g) Line 13 C++
Duke's Army.exe!main() Line 11 C++
[External Code]
Andere Antworten ein statisches Element empfehlen Entfernen folgt, ist die nicht richtig oder so etwas wie das erklärt wurde. In der (vermutlich) betroffenen Klasse gibt es jedoch einen statischen Vektor, den ich nicht entfernen kann. Irgendwelche Vorschläge?
[Dies ist die Klasse denke ich, die Fehler tritt aus]
Tile.h
class Tile
{
public:
static std::vector<Tile> tiles;
// Constructors and methods...
// Method used in constructors to add to static tiles
void Tile::init(const std::string& n, const sf::Color& c) {
this->name = n;
this->color = c;
tiles.push_back(*this);
}
Tile(std::string n, sf::Color c) {
init(n, c);
};
Tile() {
init("bounds", sf::Color::Black);
}
const static Tile wall;
const static Tile floor;
const static Tile bounds;
const static float TILE_SIZE;
};
Static (Linie 19 in den Call-Stack der Beginn der Definition des Default-Konstruktor ist) Mitglieder sind in Tile.cpp erklärt
std::vector<Tile> Tile::tiles = std::vector<Tile>(3);
const Tile Tile::wall("wall", sf::Color::White);
const Tile Tile::floor("floor", sf::Color::Green);
const Tile Tile::bounds;
const float Tile::TILE_SIZE = 16.f;
Ich glaube nicht, das Problem in jedem Deklarationscode sein wird. Überprüfen Sie Ihre Konstruktoren und Methoden. –
'const Tile Tile :: xxxx' sollte' const Tile :: xxxx' sein –
@ Jean-FrançoisFabre Um. Ich denke nicht. Diese Mitglieder (drei davon) sind 'Tile'-Objekte, statisch für die Klasse' Tile' (was erlaubt ist). – WhozCraig