Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Can compile and execute but can't debug  (Read 4193 times)

0 Members and 1 Guest are viewing this topic.

Leodido

  • Newbie
  • *
  • Posts: 10
    • View Profile
Can compile and execute but can't debug
« 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

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Can compile and execute but can't debug
« Reply #1 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.
Laurent Gomila - SFML developer

Leodido

  • Newbie
  • *
  • Posts: 10
    • View Profile
Can compile and execute but can't debug
« Reply #2 on: March 17, 2010, 04:50:26 pm »
thanks it worked :)

gsaurus

  • Sr. Member
  • ****
  • Posts: 262
    • View Profile
    • Evolution Engine
Can compile and execute but can't debug
« Reply #3 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)
Pluma - Plug-in Management Framework

Mindiell

  • Hero Member
  • *****
  • Posts: 1261
    • ICQ Messenger - 41484135
    • View Profile
Can compile and execute but can't debug
« Reply #4 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:
Mindiell
----

gsaurus

  • Sr. Member
  • ****
  • Posts: 262
    • View Profile
    • Evolution Engine
Can compile and execute but can't debug
« Reply #5 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.
Pluma - Plug-in Management Framework

Gammenon

  • Newbie
  • *
  • Posts: 27
    • View Profile
Can compile and execute but can't debug
« Reply #6 on: April 29, 2010, 12:30:07 pm »
Disable Comodo Firewall Defense+. You need to reset your computer.