Visual C++ Developer Center >
Visual C++ Forums
>
Visual C++ General
>
Confused about the file structure of VC++ solutions
Confused about the file structure of VC++ solutions
- Hello all,I'm experiencing absolutely bizarre behavior when trying to debug my app. When I place a breakpoint in a location in one of my files the debugger won't break even though it is on a valid line. If I pick another location, the debugger breaks but then seems to move around randomly when I step through my code. For example, if I have a nested if/else-if/else-if/ block, when stepping through with the debugger I notice that code inside all the if-else conditional blocks is visited (!), some lines are skipped for no apparent reason, just general craziness. It's as if the environment was debugging another file and not the one I see being stepped through on the screen.Out of desperation I started looking closely at the files generated by the Visual Studio wizard and noticed that my Dll project has the following structure:c:\MyDllProject->MyDllProjectThe outer "MyDllProject" folder contains an inner "MyDllProject" folder as well as "Debug" and "Release" folders. It also contains my source files. The inner "MyDllProject" folder, however, also contains "Debug" and "Release" fodlers. Why do I have 2 pairs of Debug/Release folders? I should also note that I am using the Intel C++ plug-in.Thanks in advance.-Confused
Answers
- The bizarre behavior for debugger stepping is normal if you are debugging a release build. It should not happen when debugging a debug build.
- Marked As Answer byWesley YaoMSFT, ModeratorTuesday, November 10, 2009 3:24 AM
- As Scott said, there is heavy optimization done in release mode.So some lines of your code have been either eliminated or optimized by the compiler.You can still step through you code in release mode if you turn off optimization in the project properties in the C/C++ -> Optimization and Linker -> Optimization.
«_Superman_»
Microsoft MVP (Visual C++)- Marked As Answer byWesley YaoMSFT, ModeratorTuesday, November 10, 2009 3:24 AM
All Replies
- The bizarre behavior for debugger stepping is normal if you are debugging a release build. It should not happen when debugging a debug build.
- Marked As Answer byWesley YaoMSFT, ModeratorTuesday, November 10, 2009 3:24 AM
- As Scott said, there is heavy optimization done in release mode.So some lines of your code have been either eliminated or optimized by the compiler.You can still step through you code in release mode if you turn off optimization in the project properties in the C/C++ -> Optimization and Linker -> Optimization.
«_Superman_»
Microsoft MVP (Visual C++)- Marked As Answer byWesley YaoMSFT, ModeratorTuesday, November 10, 2009 3:24 AM


