1. Install MINGW64
Download and install . Assume that you install it under C:\mingw64.
2. Set up compiler
Open Code::Block. Go to Settings > Compiler. Under the drop down list of selected compiler, the GNU GCC Compiler should be selected by default. We will copy the settings of this compiler and then modify it.
Click on Copy and give a new name for the compiler that you are going to set up. You can name it whatever you want (e.g. GNU GCC Compiler (x64)).
One last step, you need to update the toolchain under the tab Toolchain executables. Modify the compiler’s installation directory to the directory of MinGW64 (e.g C:\mingw64). Also update the following under Program Files:
C compiler: x86_64-w64-mingw32-gcc.exe
C++ compiler: x86_64-w64-mingw32-g++.exe
Linker for dynamic libs: x86_64-w64-mingw32-g++.exe
Linker for static libs: x86_64-w64-mingw32-gcc-ar.exe
Now you can go ahead to use this compiler to compiler your program.
3. Set up debugger
With the above steps, you won’t be able to debug your program yet. You will probably get the following error message:
[code]
Starting the debuggee failed: No executable specified, use `target exec’.
Debugger finished with status 0
[/code]
Now you have to set up the debugger under Settings > Debugger…. Select on GDB/CDB debgger, and Create Config. In the popup window, enter the name for the configuration. I am calling it gdb64 here. Under Executable path, select the corresponding gdb debugger for mingw64.
Finally, go back to the toolchain page for GNU GCC Compiler (x64), and switch the debugger to gdb64.