Why code doesn't break at breakpoint in code blocks

I followed the instructions in this video to run the code line by line:

http://www.youtube.com/watch?v=6CGH9Z19dS8

However, after I pressed F8, it just ran, not reaching the breakpoint (I could not see the yellow triangle). In addition, I also tried to “attach to the process”, and it was the same.

Did I miss something? (By the way, there are several files in my project, but I think that this is not a problem, right? Because I could do it easily in VS-studio. Maybe I am not familiar with CodeBlocks)

Thanks for the help!

If you're interested, this is the debug log:

Building to ensure sources are up-to-date
Selecting target: 
Release
Adding source dir: C:\Users\liuca_000\Documents\Lattice_Boltzmann_code\lattice_boltzmann\
Adding source dir: C:\Users\liuca_000\Documents\Lattice_Boltzmann_code\lattice_boltzmann\
Adding file: C:\Users\liuca_000\Documents\Lattice_Boltzmann_code\lattice_boltzmann\bin\Release\lattice_boltzmann.exe
Changing directory to: C:/Users/liuca_000/Documents/Lattice_Boltzmann_code/lattice_boltzmann/.
Set variable: PATH=.;C:\Program Files (x86)\CodeBlocks\MinGW\bin;C:\Program Files (x86)\CodeBlocks\MinGW;C:\Python27\Lib\site-packages\PyQt4;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Python27;C:\Python27\DLLs;C:\Python27\Scripts;C:\Python27\Lib\site-packages\vtk;C:\Python27\gnuplot\binary;C:\Python27\Lib\site-packages\osgeo;C:\Program Files (x86)\pythonxy\SciTE-3.3.2-3;C:\Program Files (x86)\pythonxy\console;C:\MinGW32-xy\bin;C:\Program Files (x86)\pythonxy\swig;C:\Program Files (x86)\pythonxy\gettext\bin;C:\Program Files\MATLAB\R2012b\runtime\win64;C:\Program Files\MATLAB\R2012b\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files\MiKTeX 2.9\miktex\bin\x64;C:\Program Files (x86)\Windows Live\Shared;C:\Users\liuca_000\AppData\Roaming\MiKTeX\2.9\miktex\bin\x64;.;\
Starting debugger: C:\Program Files (x86)\CodeBlocks\MINGW\bin\gdb.exe -nx -fullname  -quiet  -args C:/Users/liuca_000/Documents/Lattice_Boltzmann_code/lattice_boltzmann/bin/Release/lattice_boltzmann.exe
done
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
Reading symbols from C:\Users\liuca_000\Documents\Lattice_Boltzmann_code\lattice_boltzmann\bin\Release\lattice_boltzmann.exe...(no debugging symbols found)...done.
Debugger name and version: GNU gdb (GDB) 7.5
Child process PID: 16672
[Inferior 1 (process 16672) exited normally]
Debugger finished with status 0
+4
source share
4 answers

, , :

( )

- , , , .

+3

, , :

  • ", " release "" release "" debug "
  • " "
  • "- g ticked, -s unticked"
  • " "

, , , IDE, , , , . , , ! XD

+1

, , , , . (, )

, ( ); Release, Debug.

:

: C:\Users\liuca_000\Documents\Lattice_Boltzmann_code\lattice_boltzmann\bin\Release\lattice_boltzmann.exe

:

C:\Users\liuca_000\Documents\Lattice_Boltzmann_code\lattice_boltzmann\bin\Release\lattice_boltzmann.exe... ( )... done.

, Release, <project_dir>\bin\Release ( ), Debug <project_dir>\bin\Debug

, "" , .

, :

  • lattice_boltzmann
    • Debug
    • Release

Release. , Release . , : -

  • , , - ( ), , , , .

  • Release .

, , , , . :

  • Go to the top menu bar BuildChoose Target
  • Clear the Release check box . Check Debugging

Then Restore the project (i.e. clean and build) and you can debug it properly. Code :: Blocks the default options for the Debug assembly.

Remember to go back and remove the parameter -gfrom the Release configuration .

0
source

All Articles