Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2944521
  • 博文数量: 1025
  • 博客积分: 12961
  • 博客等级: 上将
  • 技术积分: 12225
  • 用 户 组: 普通用户
  • 注册时间: 2009-01-09 11:25
个人简介

偷得浮生半桶水(半日闲), 好记性不如抄下来(烂笔头). 信息爆炸的时代, 学习是一项持续的工作.

文章分类

全部博文(1025)

文章存档

2018年(73)

2017年(81)

2016年(70)

2015年(52)

2014年(41)

2013年(53)

2012年(85)

2011年(46)

2010年(233)

2009年(291)

分类: Windows平台

2016-03-25 09:01:23

http://yzhong.co/codeblock-compile-64-bit-under-windows-with-mingw-w64/

1. Install MINGW64

Download and install MinGW-w64. 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)).

codeblock - add new compiler

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

codeblock - comiler settings - update toolchain

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.

codeblock - debugger

Finally, go back to the toolchain page for GNU GCC Compiler (x64), and switch the debugger to gdb64.

codeblock - compiler

This entry was posted in IDE and tagged  on May 21, 2014.
阅读(2393) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~
评论热议
请登录后评论。

登录 注册