Visual C++ 2005 Express Edition: Breakpoints not working

This is a discussion on Visual C++ 2005 Express Edition: Breakpoints not working within the C++ Programming forums, part of the General Programming Boards category; I realize that breakpoint is a useful feature in VC++ 2005 EE and have tried it in a test program. ...

  1. #1
    Registered User
    Join Date
    Feb 2006
    Posts
    15

    Visual C++ 2005 Express Edition: Breakpoints not working

    I realize that breakpoint is a useful feature in VC++ 2005 EE and have tried it in a test program. However, in a project I am writing, the breakpoint feature does not work.

    After I set a breakpoint and start the debug window, the breakpoint icon becomes hollow and states:

    The breakpoint will not currently be hit. No symbols loaded for this document.

    The project I am doing has two classes I created along with the main class. So far, the entire project is just below 400 lines and the backbone of this program almost set.

    I will gladly provide more information if needed.

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,558
    Did you build for "debug" or "release" ?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Registered User
    Join Date
    Feb 2006
    Posts
    15
    Debug

  4. #4
    Tropical Coder Darryl's Avatar
    Join Date
    Mar 2005
    Location
    Cayman Islands
    Posts
    503
    The breakpoint will not currently be hit...
    That's your answer right there. The breakpoint won't be reached... for example
    Code:
    if (false)
    {
         int a = 100; <----- This code will never be reached! So setting a breakpoint is useless
    }

  5. #5
    Registered User
    Join Date
    Feb 2006
    Posts
    15
    Well I would've comprehended the error message had the error not occur every line I tested with breakpoints...

  6. #6
    Registered User
    Join Date
    Jan 2005
    Posts
    7,328
    You also might have the wrong file open, or perhaps that code isn't built with the current project, or some other issue. This often happens to me when I open the same file but in a previous version (in a different directory), or when code is conditionally removed from compilation through precompiler directives.

    Basically, unless there is something wrong with your debugger setup, that code in that file will never be reached in your program. One way to test is to step through the program from the beginning until you reach a line of code that is giving you trouble. When you get to that line of code, try to set the breakpoint.

  7. #7
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,558
    How about starting with a simple main printing "hello world" and see if you can set a breakpoint on that.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  8. #8
    Registered User
    Join Date
    Feb 2006
    Posts
    15
    The Hello World program did not work. However, a user from another forum suggested changing some of my settings in the Project Configuration:

    C/C++ -> General -> Debug Information Format: Program Database for Edit & Continue
    C/C++ -> Optimization -> Optimization: Disabled

    Linker -> General -> Enable Incremental Linking: Yes
    Linker -> Debugging -> Generate Debug Info: Yes

    Now breakpoints do work, but I'm going to have to learn to use it better :P

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Can we have vector of vector?
    By ketu1 in forum C++ Programming
    Replies: 24
    Last Post: 01-03-2008, 04:02 AM
  2. Compile Error in Visual C++ 2005 express
    By Fremontknight1 in forum C++ Programming
    Replies: 9
    Last Post: 10-19-2007, 04:28 PM
  3. Help: Microsoft Visual Basic 2005 Express Editon
    By karlawarla in forum Windows Programming
    Replies: 5
    Last Post: 11-22-2006, 01:46 PM
  4. pointer to array of objects of struct
    By undisputed007 in forum C++ Programming
    Replies: 12
    Last Post: 03-02-2004, 03:49 AM
  5. Using 'if' with char arrays or string objects
    By c++_n00b in forum C++ Programming
    Replies: 36
    Last Post: 06-06-2002, 09:04 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21