使用源码包安装codeblocks
一、登录http://www.codeblocks.org/home进入codeblocks官网
点击Download进入下载界面
如图所示选择源码安装
选择第一个进入下载用进入SourceForge(全球最大开源软件开发平台和仓库)下载。
对源码包进行解压。
tar -zxvf codeblocks_13.12-1.tar.gz解压到当前文件夹下
cd codeblocks进入文件夹
如图所示:使用Vim README打开后如图所示
打开COMPLIERS后看见如下信息
大概是说Linux下安装要依赖GCC和GDB,如果没有安装的要记着把GCC安装好
使用./configure检测依赖问题,如图所示提示错误wx-config没安装
安装上wxwindows
zsheng@ubuntu:~/codeblocks-13.12$ wx-config
The program 'wx-config' can be found in the following packages:
* libwxbase2.8-dbg
* libwxbase2.8-dev
* libwxgtk2.8-dbg
* libwxgtk2.8-dev
Try: sudo apt-get install <selected package>
按照它要求的做
zsheng@ubuntu:~/codeblocks-13.12$ sudo apt-get install libwxbase2.8-dbg \
> libwxbase2.8-dev libwxgtk2.8-dbg libwxgtk2.8-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
libwxbase2.8-0 libwxgtk2.8-0 wx-common wx2.8-headers
Suggested packages:
wx2.8-doc libgl1-mesa-dev libgl-dev xlibmesa-glu-dev libglu-dev
The following NEW packages will be installed:
libwxbase2.8-0 libwxbase2.8-dbg libwxbase2.8-dev libwxgtk2.8-0
libwxgtk2.8-dbg libwxgtk2.8-dev wx-common wx2.8-headers
0 upgraded, 8 newly installed, 0 to remove and 316 not upgraded.
Need to get 50.1 MB of archives.
After this operation, 129 MB of additional disk space will be used.
Do you want to continue [Y/n]?
我们点击回车以继续下载安装
在下载完成后一些安装程序安装完成后,我们继续
在此运行./configure提示还有没安装
No package 'gtk+-2.0' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables GTK2_CFLAGS
and GTK2_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
zsheng@ubuntu:~/codeblocks-13.12$
继续安装这个sudo apt-get install gtk+-2.0之后又是漫长下载安装和等待。
一段时间的等待之后,终于是安装好了,接下来继续检测依赖问题
*************************************************
* Code::Blocks source tree has been configured. *
*************************************************
You can now build Code::Blocks by issuing 'make'.
When the build is complete, become root and install
it by issuing 'make install'.
这下终于搞定依赖问题了。
./configure --prefix=/usr/local/codeblocks
将之安装在/usr/local/codeblocks之下
接下来sudo make && make install
接下来就是编译和安装了又是漫长的等待
没有提示错误,这下安装好了。
进去开启试试:
zsheng@ubuntu:/usr/local/codeblocks/bin$ ./codeblocks
如下安装好了,哈哈,就此完成。