来源:http://jianhai1229.blog.163.com/blog/static/3488700020101251158539/
第一步 安装Codeblocks
运行Ubuntu下的终端(应用程序--附件--终端)
输入命令:sudo apt-get install libwxbase2.8-0 libwxgtk2.8-0
在新立得软件包管理器(系统--系统管理--新立得软件包管理器)中输入:codeblocks点击搜索
勾选
codeblocks-contrib,codeblocks-dbg,codeblocks-dev,codeblocks
勾选 libcodeblocks0,libwxsmithlib0-dev,libwxsmithlib0
第二步 配置arm-linux运行环境
1. 下载“arm-linux-gcc-4.3.2 ” (http://www.friendlyarm.net/dl.php?file=arm-linux-gcc-4.3.2.tgz)
2. 用Root用户登录系统,在终端中输入 “tar xvzf arm-linux-gcc-4.3.2.tgz –C
/(arm-linux-gcc-4.3.2.tgz的绝对路径或者直接拖arm-linux-gcc-4.3.2.tgz到终端)’”
3. 一般情况下应该会被解压缩到/root/usr/local/
4. 复制到/usr/local/arm/4.3.2
5. 注销或重启电脑
6. 启动Codeblocks,选择Settings--Compiler and debugger菜单,在Select
compiler选项中选择GNU ARM GCC compiler并设置它为默认。
7. 在tab控件中选择Toolchain executables (确保这个窗口最大,不然你可能看不到这个Toolchain
executables),在Compiler’s installation directory中输
入/usr/local/arm/4.3.2 (bin not necessary)
8. 在Program Files确保:
C compiler arm-linux-gcc
C++ compiler arm-linux-g++
Linker for dynamic script arm-linux-g++
Linker for static libs arm-linux-ar
Debugger arm-linux-gdb
这样设置就好了。
你选择新建一个arm工程就可以编译运行了。
Quote:
sudo aptitude install build-essential
|
That installs g++, gcc, make, etc.
否则 你会
Compiling: main.cpp
/bin/sh: g++: not found
报这个错误