CentOS6.3 下安装codeblocks
2016-09-18 10:30
357 查看
本人用的系统是centos6.3(虚拟机) 需要预先安装gcc编译器(参考:http://www.cnblogs.com/magialmoon/archive/2013/05/05/3061108.html)
1、先安装GTK+
然后运行如下命令:
ldconfig命令的作用是让动态链接库为系统所共享,source命令的作用简单来说就是使得配置文件的修改立即生效而不需要重启。
3、下载并安装codeblocks
地址:https://sourceforge.net/projects/codeblocks.berlios/files/codeblocks_12.11-1.tar.gz/download?use_mirror=jaist
解压,然后执行:./bootstrap
bootstrap命令的作用是设置configure脚本及其依赖关系,这个命令只需要执行一次,运行这个命令如果出现下面的错误:
说明机子上没有安装“libtool”,yum安装下即可:
可能还会报错:
将wxGTK-2.8.12下的wxwin.m4复制到/usr/share/aclocal
configure
然后 make make install
设置LD_LIBRARY_PATH变量:
这种方式是临时的设置环境变量,关闭shell就会失效,需要永久的设置环境变量参看这里这里,修改/etc/profile文件,加入下面这行:
LD_LIBRARY_PATH这个环境变量的作用是让其他程序找到第三方的动态连接库。设置后就没可以通过命令行启动C::B了。
4、如果发现codeblocks无法启动命令行窗口,提示:terminated with status 255,则需要安装xterm。命令:yum install -y xterm
5、在使用多线程时,如果提示"undefined reference to pthread_create()"等之类的错误,则需要手动将pthread链接库加入到项目中:右键项目-》build选项-》链接器设置-》添加路径“/usr/lib/libpthread.so”。
1、先安装GTK+
yum install gtk+*
2、下载并安装<span style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13.92px; line-height: 20.88px;">wxGDK 下载地址:<a target=_blank href="http://www.wxwidgets.org/downloads/">wxGTK下载地址</a></span>
以<span style="font-family:Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 13.92px; line-height: 20.88px;">wxGTK-2.8.12.tar.gz为例</span></span>
<span style="font-family:Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: 13.92px; line-height: 20.88px;">首先将它解压:</span></span><pre name="code" class="plain">tar zxvf wxGTK-2.8.12.tar.gz cd wxGTK-2.8.12
安装:
<pre name="code" class="plain">mkdir build_gtk2_shared_monolithic_unicode cd build_gtk2_shared_monolithic_unicode ./configure --prefix=/opt/wx/2.8 \ --enable-xrc \ --enable-monolithic \ --enable-unicode make su make install exit
<span style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13.92px; line-height: 20.88px;">安装的路径是</span><span style="margin: 0px; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13.92px; line-height: 20.88px; color: rgb(255, 0, 0);">/opt/wx/2.8/</span>
<span style="margin: 0px; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13.92px; line-height: 20.88px;"><span style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13.92px; line-height: 20.88px;"><span style="color:#ff0000;">设置环境变量:</span></span></span><pre style="color: rgb(51, 51, 51); margin-top: 0px; margin-bottom: 0px; padding: 0px; white-space: pre-wrap; word-wrap: break-word; border-radius: 4px; line-height: 20px; word-break: break-all; border: 0px solid rgba(0, 0, 0, 0.14902); border-image-source: initial; border-image-slice: initial; border-image-width: initial; border-image-outset: initial; border-image-repeat: initial; font-family: 'Courier New' !important; background-color: rgb(245, 245, 245);">export PATH=/usr/bin:/opt/wx/<span style="margin: 0px; padding: 0px; color: rgb(128, 0, 128); line-height: 1.5 !important;">2.8</span>/bin:$PATH
然后运行如下命令:
ldconfig source /etc/profile
ldconfig命令的作用是让动态链接库为系统所共享,source命令的作用简单来说就是使得配置文件的修改立即生效而不需要重启。
3、下载并安装codeblocks
地址:https://sourceforge.net/projects/codeblocks.berlios/files/codeblocks_12.11-1.tar.gz/download?use_mirror=jaist
解压,然后执行:./bootstrap
bootstrap命令的作用是设置configure脚本及其依赖关系,这个命令只需要执行一次,运行这个命令如果出现下面的错误:
./bootstrap: libtoolize: not found
说明机子上没有安装“libtool”,yum安装下即可:
yum install libtool
可能还会报错:
configure.in:79: warning: macro `AM_OPTIONS_WXCONFIG' not found in library configure.in:80: warning: macro `AM_PATH_WXCONFIG' not found in library configure.in:79: error: possibly undefined macro: AM_OPTIONS_WXCONFIG If this token and others are legitimate, please use m4_pattern_allow. See the Autoconf documentation. configure.in:80: error: possibly undefined macro: AM_PATH_WXCONFIG
将wxGTK-2.8.12下的wxwin.m4复制到/usr/share/aclocal
cp ../wxwin.m4 /usr/share/aclocal
configure
./configure --with-wx-config=/opt/wx/2.8/bin/wx-config
然后 make make install
设置LD_LIBRARY_PATH变量:
export LD_LIBRARY_PATH =/opt/wx/2.8/lib/
这种方式是临时的设置环境变量,关闭shell就会失效,需要永久的设置环境变量参看这里这里,修改/etc/profile文件,加入下面这行:
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/opt/wx/2.8/lib" source /etc/profile
LD_LIBRARY_PATH这个环境变量的作用是让其他程序找到第三方的动态连接库。设置后就没可以通过命令行启动C::B了。
4、如果发现codeblocks无法启动命令行窗口,提示:terminated with status 255,则需要安装xterm。命令:yum install -y xterm
5、在使用多线程时,如果提示"undefined reference to pthread_create()"等之类的错误,则需要手动将pthread链接库加入到项目中:右键项目-》build选项-》链接器设置-》添加路径“/usr/lib/libpthread.so”。
相关文章推荐
- centos6.3 安装codeblocks
- CentOS 5.5下安装CodeBlocks 10.05
- centOS6.3安装Flash插件
- CentOS-6.3-minimal安装gnome桌面环境(转载)
- CentOS 6.3 运维监控之Cacti 详细安装(一)
- CentOS-6.3-x86_64上安装KVM
- centos 5.2上安装codeblocks
- CentOS6.3 x86_64位安装xfce4桌面vncserver服务
- 使用centos6.3自带的openJDK安装cassandra问题
- CentOs6.3上安装Oracle11g的注意点
- Centos6.3 下安装postgresql9.1.5和postgis1.5.5(左脑版)
- CentOS6.3 64位安装wine出错,牛人帮帮忙
- centos 6.3 下安装python IDE:Eric4
- [转载]定制CentOS 6.3 自动安装盘
- CentOS 6.3安装配置LAMP服务器(Apache+PHP5+MySQL)
- centos安装CODEBLOCKS
- 定制CentOS 6.3 自动安装盘
- centos 6.3安装nginx 配置文件服务器
- CentOs6.3 x64位 安装java jdk
- CentOS6.3 x86_64 最小化安装后安装man