SFML community forums

Help => General => Topic started by: Leodido on March 17, 2010, 04:02:13 pm

Title: Can compile and execute but can't debug
Post by: Leodido on March 17, 2010, 04:02:13 pm
I have set everything like in the tutorial for visual C++ 2008 express edition, and i can compile fine and if I execute the program it works fine but if I try to debug as soon as the the console pops up I get an unhandled exception and apparently SFML could not load my game resources so I decide to abort the game.

Otherwise the data are loaded correctly since I could play my tetris ^^

Also on another computer I can debug perfectly fine but not on this one (Windows 7 64 bit and the other is XP btw)

I double checked and I use the  following files for linker->input->additionnal dependencies

sfml-system-d.lib
sfml-window-d.lib
sfml-graphics-d.lib
sfml-audio-d.lib
Title: Can compile and execute but can't debug
Post by: Laurent on March 17, 2010, 04:11:11 pm
You must set the working directory in your project settings (in "debugging"). Set it to $(TargetDir) so that it is always the same path as the executable.
Title: Can compile and execute but can't debug
Post by: Leodido on March 17, 2010, 04:50:26 pm
thanks it worked :)
Title: Can compile and execute but can't debug
Post by: gsaurus on March 17, 2010, 08:51:58 pm
I have a problem with debugger too, but I didn't pay much attention to it yet, I rarely use debugger :lol:

It compile and run perfectly on debug target, but if I start the debugger it explodes immediately with segmentation fault:
Quote
Program received signal SIGSEGV, Segmentation fault.
In guard32!?Exported@@YAXXZ () (C:\WINDOWS\system32\guard32.dll)


It happens if I use SFML classes other than the simplest ones (like sf::Clock,  sf::IntRect, sf::Event, etc.. if I only use classes like those, debugger doesn't explode)

code::blocks (mingw)
Title: Can compile and execute but can't debug
Post by: Mindiell on March 18, 2010, 08:26:29 am
Don't you have a source code to show ?
a minimal one giving the same error ?

I had these kind of error recently and it was all my fault  :oops:
Title: Can compile and execute but can't debug
Post by: gsaurus on March 18, 2010, 03:09:31 pm
Nah, this isn't a question of code, it should be something deeper.
As simple as this:
Code: [Select]
#include <SFML\Window.hpp>
int main(){
    sf::Window wn;
    return EXIT_SUCCESS;
}


It compiles and run fine:
Quote
mingw32-g++.exe -Wall -fexceptions -DSFML_DYNAMIC  -g  -Wall   -I..\..\include  -c "<project path here>\main.cpp" -o ..\..\Temp\Debug\main.o
mingw32-g++.exe -L..\..\lib  -o ..\..\lib\testing-d.exe ..\..\Temp\Debug\main.o   -lsfml-window-d -lsfml-system-d  
Output size is 245.90 KB
Process terminated with status 0 (0 minutes, 2 seconds)
0 errors, 0 warnings

I have reinstalled c::b and minGW but it does the same.
Title: Can compile and execute but can't debug
Post by: Gammenon on April 29, 2010, 12:30:07 pm
Disable Comodo Firewall Defense+. You need to reset your computer.