News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Debugging or Compiling and running

Started by J-C, May 02, 2011, 07:48:09 PM

Previous topic - Next topic

J-C

Ok I have searched not only here but over the internet, and so far I can't seem to find a solution...

The thing is I try debugging my game and a console shows for like 100 milliseconds? then just quits.

I CAN run the app on the debug folder and it works wonderful, but I want to Debug, and be able to run it with out going to the folder it is at... Any help is appreciated.

oBFusCATed

Can you describe exactly what you're doing? (please write all the steps you do)
Does debugging works with simple console project?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

J-C

 What I do:

step 1: I have all my code and load all my files

step 2: code compiles and works fine.

step 3: if I try to compile and run, it compiles but when it runs it shows a DOS window and closes, same if I try to debug....

I don't know how to be clearer.

oBFusCATed

Try the console project :)

Also you can paste the full debugger's debug log from a debug session (after the debug -> start)?
The log should be enabled in settings->compiler & debugger -> debugger.
Use code tags, please.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

J-C

I have this question before I do that, do I have to include, libraries and what not on the PROJECT build options as well, to be able to debug?

J-C

Building to ensure sources are up-to-date
Build succeeded
Selecting target:
Debug
Adding source dir: C:\DarkQ\DarkQ\
Adding source dir: C:\DarkQ\DarkQ\
Adding file: bin\Debug\DarkQ.exe
Starting debugger:
done
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
Debugger name and version: GNU gdb 6.8
Child process PID: 7100
Program exited with code 01.
Debugger finished with status 0

seb_seb0

Quote from: J-C on May 02, 2011, 09:48:25 PM
Program exited with code 01.
Debugger finished with status 0

apparently, your program is exiting with an error code. Have you tried to set a breakpoint at the 1st instruction of the program ?

J-C

I found out why... it exits when it is loading files? why is that? you can't load files while debugging?

oBFusCATed

You have problems with the paths probably.
You're assuming that the working this is <project>/bin/Debug, but when started from C::B the default is <project>.
See project properties for details.

For debugging with C::B read this: http://wiki.codeblocks.org/index.php?title=Debugging_with_Code::Blocks
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

J-C

#9
you were absolutely right sir, *face palm* it was the path, man I feel like a retard now... thanks a lot man :D, But it doesn't say anything on how to change the path?

seb_seb0

Quote from: J-C on May 02, 2011, 10:05:54 PM
you were absolutely right sir, *face palm* it was the path, man I feel like a retard now... thanks a lot man :D, But it doesn't say anything on how to change the path?

You are not alone, I had the exact same problem 3 month ago.
See the bright side: the debugger has helped you to find a mistake (not the way you planned, but still). It has done its job !

J-C

LOL yeah :P but how do I change or add the path to the images? or should I just copy them in the default folder?

oBFusCATed

project -> properties -> build targets

To not feel like a retard scroll around the menus, to see what features C::B has. There are some surprises :)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

J-C

I did just that actually after posting that lol, but anyways for some reason it wasn't working but I got it, thanks again, C::B is new to me, I always used VC++ but I am Loving C::B :D