Thread: debugger problem with VC++ express

  1. #1
    Registered User Frenzied's Avatar
    Join Date
    Jul 2006
    Location
    UK
    Posts
    4

    debugger problem with VC++ express

    Since i'm new to the board hello to everyone

    I'm pretty new to C++ and I've just started using Microsofts Visual C++ express. I've just finished writing a program and thought i'd experiment with the debugger. When I tried to start it I got this dialog:

    'Debugging info for 'TurtleDraw.exe' cannot be found or does not match. Binary was not built with debug info. Do you want to continue debug?'

    I'm assuming I haven't set up VC++ properly or something. Can anyone tell me what I need to do?

    thanks

  2. #2
    Registered User
    Join Date
    Aug 2005
    Posts
    1,267
    you have to compile for debug mode, not release mode. There should be a dialog box titled "Solutions Configuration" -- change it to Debug then recompile everything.

  3. #3
    Registered User Frenzied's Avatar
    Join Date
    Jul 2006
    Location
    UK
    Posts
    4
    Thanks, i'll go check that out.

  4. #4
    Hardware Engineer
    Join Date
    Sep 2001
    Posts
    1,398
    FYI Frenzied,

    A normal EXE file doesn't contain any variable names, function names, line numbers, etc.

    So, the compiler can make a special EXE file and (somehow) keep track of how the lines & variables in the machine language EXE file relate-back to the lines & variables in your C++ language source file.

    And, there are "break-points" inserted into the machine code, so that execution can be "paused" and re-started. (I assume that the break-points are actually "do-nothing loops".)

  5. #5
    Registered User mrafcho001's Avatar
    Join Date
    Jan 2005
    Posts
    483
    no its not a loop... it just halts the execution, and yes it inserts code into the exe which helps it monitor the variables and what line of code is being executed.
    My Website
    010000110010101100101011
    Add Color To Your Code!

  6. #6
    Registered User Frenzied's Avatar
    Join Date
    Jul 2006
    Location
    UK
    Posts
    4
    I understand, so with release mode you just get the machine code which is the program I have just written, but with debug mode you get extra debugging machine code, is that right?

  7. #7
    Registered User
    Join Date
    Aug 2005
    Posts
    1,267
    yes that is right -- and the debug .exe file will be at least twice the size of a program without debug info and it will run slower too. So programs compiled for debug are not something that one would want to give to someone else unless they also want it for debugging.

  8. #8
    Registered User mrafcho001's Avatar
    Join Date
    Jan 2005
    Posts
    483
    also most of the time it wont even work, the debug .exes use extra dlls not found on the average user's computer.
    My Website
    010000110010101100101011
    Add Color To Your Code!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM
  2. Running Program Problem
    By warfang in forum C++ Programming
    Replies: 10
    Last Post: 03-28-2007, 02:02 PM
  3. Problem using gdb debugger.....
    By manny in forum Tech Board
    Replies: 7
    Last Post: 09-18-2006, 01:26 AM
  4. Laptop Problem
    By Boomba in forum Tech Board
    Replies: 1
    Last Post: 03-07-2006, 06:24 PM
  5. half ADT (nested struct) problem...
    By CyC|OpS in forum C Programming
    Replies: 1
    Last Post: 10-26-2002, 08:37 AM