I have looked through the code which I didn't thoroughly check yesterday and have one more suggestion for you.
I've noticed that the program crashes not right after pressing the spacebar, but when the spaceship reaches the starting position and the program begins to update the asteroids. (So you are right, the trouble should be in asteroid.cpp.) This might be the cause:
// Let's load our asteroid image and
dbLoadImage("Images\\asteroid.png", 401);
// Clones our asteroid.
for (int x = 402; x < 4011; x ++) {
dbCloneSprite(401, x);
}
// Creates our asteroid sprites in the game.
dbSprite(401, gAsteroidX, gAsteroidY, 401);
dbSprite(402, gAsteroidX + 50, gAsteroidY, 401);
Here you clone the sprite before it's created. The 401 you give in dbLoadImage is an image number, but dbCloneSprite expects a sprite number, and a sprite 401 does not exist at that point. It is created only in the dbSprite(401, .... 401) line afterwards.
In fact you can completely remove the lines that clone the sprites and the program will still work, because the dbSprite commands will create all the sprites.
// Let's load our asteroid image and
dbLoadImage("Images\\asteroid.png", 401);
// Creates our asteroid sprites in the game.
dbSprite(401, gAsteroidX, gAsteroidY, 401);
dbSprite(402, gAsteroidX + 50, gAsteroidY, 401);
Does that help? It's strange that I can't reproduce the crash on my machine, but this may well cause it.
Another thing that I noticed is that you delete the asteroid sprites when there is a collision. That means that in the next game loop, you will use dbMoveSprite and dbSpriteCollision commands for non-existent sprites. Dark GDK commands do not return error codes (unfortunately) but some of them write error codes into the first integer position on the stack. This can ruin the first variable of the main program, but I haven't yet seen a crash caused by this. In any case, deleting an asteroid comes much later than starting the level, so this is surely not the issue here. (EDIT: If this were the problem, the program would crash after hitting the first asteroid, but it doesn't get that far.) For the future, it would be better to solve it somehow that only existing sprites are referenced.
Otherwise, maybe the code is not as efficient as it could be (I would use arrays to handle sprites instead of copy-pasting code for each of them, and I would try to eliminate some of the global variables), but nothing else at first sight that would have such catastrophic results. (EDIT: that's why I looked at the settings, because the code seemed so straightforward that I didn't suppose the problem is in the coding.) Try removing the sprite cloning part, I hope that will solve it.