LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 5547|回复: 26

Debian下成功编译Code::Blocks-Linux下类似M$VC的集成开发环境

[复制链接]
发表于 2006-3-22 20:29:59 | 显示全部楼层 |阅读模式
Code::Blocks是Gnu/Linux下类似M$VC的集成开发环境,可以方便的进行C C++等程序的开发,并且该IDE是跨平台的,方便程序的移植。

[color="Red"]第13贴有deb包下载

本过程仅供大家参考,希望能够为寻找Linux下IDE的朋友帮上点忙

我使用的是Debia Sid,升级到最新。

首先从Code::Blocks的官方网站www.codeblocks.org下稳定版源代码,(因为官方网站上提供的预编译包不是在我的机器上运行断错误就是链接实效,下不了)。不过个人建议使用svn下载最新的源代码进行编译。svn是类似cvs的版本控制工具
apt-get install subversion,或从synaptic中搜索Subversion进行安装。

mkdir codeblocks_dev
cd codeblocks_dev
svn checkout svn://svn.berlios.de/codeblocks/trunk
则过几分钟源码就下载到了trunk目录下。
再从http://www.wxwidgets.org/,下载wxGTK-2.6.2,编译需要。
将下载到的wxGTK-2.6.2.tar.bz2也放进codeblocks_dev目录下。
tar jxf wxGTK-2.6.2.tar.bz2 解压
cd wxGTK-2.6.2

./configure --prefix=/opt/wx/2.6 \
       --enable-xrc \
       --enable-monolithic \
       --enable-unicode
make
su
make install
exit
编译安装wxGTK成功后
将 /opt/wx/2.6/bin 加到$PATH中,方法是在 /etc/profile 或 ~/.bash_profile 中加入如下语句
export PATH=/usr/bin:/opt/wx/2.6/binPATH

同时还需要把/opt/wx/2.6/lib加入/etc/ld.so.conf 文件中,然后运行:
ldconfig
source /etc/profile

然后通过以下操作检查一下
wx-config --prefix
应返回 /opt/wx/2.6
wx-config --libs
返回中至少应该有 -L/opt/wx/2.6/lib -lwx_gtk2-2.6
which wx-config
应该返回 /opt/wx/2.6/bin/wx-config

下面开始编译Code::Block

进入trunk目录,也就是最新的源码的目录。
./bootstrap
目的是为了生成可以运行./configure的相关文件。
注意此时会出现aclocal:configure.in:61: warning: macro `AM_OPTIONS_WXCONFIG' not found in library
的错误,通过export ACLOCAL_FLAGS="--acdir=`wx-config --prefix`/share/aclocal"
即可解决。

下面的就简单了,
./configure
make
make install
不过中间还是有一个小插曲,估计下的源码本身还是有个小毛病,所以make的时候会出现下面错误
projectmanager.cpp文件中cbAssert函数未定义
原因是该文件忘了将cbexception.h include进去,所以在projectmanager.cpp文件中加入
#include<cbexception.h>
再重新make
然后一路顺风,编译成功。


整个过程中还有一个大插曲。原来的开发平台是Ubuntu5.04,版本太低,需要额外安装好多库费了好多周折才能编译成功,可是运行的时候却出现‘断错误’ google了半天也没有发现解决方法,不过我估计是系统库版本太低,我为了编译而装的wxGTK与系统库有冲突。 要是升级到Ubuntu 5.10吧,提示要下载800M的文件,正好手头有一张Debian Sarge的安装盘,装好基本系统后马上升级到最新的Sid,下载的东西还能少点。转了这么多的弯不过最终可以运行了。万幸。

原文发在我的Blog上,http://www.52blog.net/user1/38568/archives/2006/644408.shtml

运行截图如下

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
发表于 2006-3-23 16:27:49 | 显示全部楼层
好文阿,怎么没人顶?

我顶一个
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-3-23 22:28:20 | 显示全部楼层
谢谢楼上兄弟
回复 支持 反对

使用道具 举报

发表于 2006-3-23 23:47:44 | 显示全部楼层
kdevelop也不错阿
回复 支持 反对

使用道具 举报

发表于 2006-3-24 14:45:03 | 显示全部楼层
You should add the contents of `/usr/share/aclocal/libtool.m4' to `aclocal.m4'.
aclocal: configure.in: 0: macro `AM_CONDITIONAL' not found in library
aclocal: configure.in: 0: macro `AM_CONDITIONAL' not found in library
aclocal: configure.in: 0: macro `AM_CONDITIONAL' not found in library
aclocal: configure.in: 0: macro `AM_CONDITIONAL' not found in library
aclocal: configure.in: 0: macro `AM_CONDITIONAL' not found in library
aclocal: configure.in: 0: macro `AM_CONDITIONAL' not found in library
aclocal: configure.in: 0: macro `AM_CONDITIONAL' not found in library
aclocal: configure.in: 0: macro `AM_CONDITIONAL' not found in library
aclocal: configure.in: 0: macro `AM_CONDITIONAL' not found in library
aclocal: configure.in: 0: macro `AM_CONDITIONAL' not found in library
aclocal: configure.in: 0: macro `AM_CONDITIONAL' not found in library
aclocal: configure.in: 0: macro `AM_CONDITIONAL' not found in library
aclocal: configure.in: 0: macro `AM_CONDITIONAL' not found in library
aclocal: configure.in: 0: macro `AM_CONDITIONAL' not found in library
aclocal: configure.in: 0: macro `AM_CONDITIONAL' not found in library
aclocal: configure.in: 0: macro `AM_CONDITIONAL' not found in library
aclocal: configure.in: 0: macro `AM_OPTIONS_WXRC' not found in library
aclocal: configure.in: 7: macro `AM_INIT_AUTOMAKE' not found in library
aclocal: configure.in: 102: macro `AM_CONDITIONAL' not found in library
回复 支持 反对

使用道具 举报

发表于 2006-3-24 14:45:03 | 显示全部楼层
You should add the contents of `/usr/share/aclocal/libtool.m4' to `aclocal.m4'.
aclocal: configure.in: 0: macro `AM_CONDITIONAL' not found in library
aclocal: configure.in: 0: macro `AM_CONDITIONAL' not found in library
aclocal: configure.in: 0: macro `AM_CONDITIONAL' not found in library
aclocal: configure.in: 0: macro `AM_CONDITIONAL' not found in library
aclocal: configure.in: 0: macro `AM_CONDITIONAL' not found in library
aclocal: configure.in: 0: macro `AM_CONDITIONAL' not found in library
aclocal: configure.in: 0: macro `AM_CONDITIONAL' not found in library
aclocal: configure.in: 0: macro `AM_CONDITIONAL' not found in library
aclocal: configure.in: 0: macro `AM_CONDITIONAL' not found in library
aclocal: configure.in: 0: macro `AM_CONDITIONAL' not found in library
aclocal: configure.in: 0: macro `AM_CONDITIONAL' not found in library
aclocal: configure.in: 0: macro `AM_CONDITIONAL' not found in library
aclocal: configure.in: 0: macro `AM_CONDITIONAL' not found in library
aclocal: configure.in: 0: macro `AM_CONDITIONAL' not found in library
aclocal: configure.in: 0: macro `AM_CONDITIONAL' not found in library
aclocal: configure.in: 0: macro `AM_CONDITIONAL' not found in library
aclocal: configure.in: 0: macro `AM_OPTIONS_WXRC' not found in library
aclocal: configure.in: 7: macro `AM_INIT_AUTOMAKE' not found in library
aclocal: configure.in: 102: macro `AM_CONDITIONAL' not found in library
回复 支持 反对

使用道具 举报

发表于 2006-3-24 14:47:39 | 显示全部楼层
顶一个 顶顶顶
回复 支持 反对

使用道具 举报

发表于 2006-3-24 16:27:40 | 显示全部楼层
我顶!!~~~~~
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-3-24 20:42:47 | 显示全部楼层
Post by dajun
You should add the contents of `/usr/share/aclocal/libtool.m4' to `aclocal.m4'.
aclocal: configure.in: 0: macro `AM_CONDITIONAL' not found in library
aclocal: configure.in: 0: macro `AM_CONDITIONAL' not found in library
aclocal: configure.in: 0: macro `AM_CONDITIONAL' not found in library
aclocal: configure.in: 0: macro `AM_CONDITIONAL' not found in library
aclocal: configure.in: 0: macro `AM_CONDITIONAL' not found in library
aclocal: configure.in: 0: macro `AM_CONDITIONAL' not found in library
aclocal: configure.in: 0: macro `AM_CONDITIONAL' not found in library
aclocal: configure.in: 0: macro `AM_CONDITIONAL' not found in library
aclocal: configure.in: 0: macro `AM_CONDITIONAL' not found in library
aclocal: configure.in: 0: macro `AM_CONDITIONAL' not found in library
aclocal: configure.in: 0: macro `AM_CONDITIONAL' not found in library
aclocal: configure.in: 0: macro `AM_CONDITIONAL' not found in library
aclocal: configure.in: 0: macro `AM_CONDITIONAL' not found in library
aclocal: configure.in: 0: macro `AM_CONDITIONAL' not found in library
aclocal: configure.in: 0: macro `AM_CONDITIONAL' not found in library
aclocal: configure.in: 0: macro `AM_CONDITIONAL' not found in library
aclocal: configure.in: 0: macro `AM_OPTIONS_WXRC' not found in library
aclocal: configure.in: 7: macro `AM_INIT_AUTOMAKE' not found in library
aclocal: configure.in: 102: macro `AM_CONDITIONAL' not found in library


可能需要将gnome终端中的‘以登陆Shell方式运行命令’选中
回复 支持 反对

使用道具 举报

发表于 2006-3-24 21:33:25 | 显示全部楼层
有空我也尝试一下
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表