unbuntu12.04下安装codeblocks

来源:互联网 发布:照片软件 编辑:程序博客网 时间:2024/05/21 09:58
1.安装code::Blocks1.1   安装wxGTK
  • 下载地址:http://www.wxwidgets.org

现在apt中添加源地址,打开终端(以12.04版本为例,其他版本安装参考:http://codelite.org/LiteEditor/WxWidgets30Binaries#toc2)

sudo apt-add-repository 'deb http://repos.codelite.org/wx3.0/ubuntu/ precise universe'
apt-get update
apt-get install libwxbase3.0-0-unofficial libwxbase3.0-dev libwxgtk3.0-0-unofficial libwxgtk3.0-dev wx3.0-headers 
apt-get install wx-common libwxbase3.0-dbg libwxgtk3.0-dbg wx3.0-i18n wx3.0-examples wx3.0-doc
安装完后验证安装,执行

wx-config --libs 
返回的结果中应该有-lwx_gtk2u-3.0等文件。

2.安装必要组件

 sudo apt-get update  sudo apt-get install build-essential sudo apt-get install gdb sudo apt-get install libgtk2.0-dev sudo apt-get install libtool sudo apt-get install autoconf

3.安装codeblocks

  • 下载codeblocks

在http://www.codeblocks.org/downloads/下载选择source中codeblocks_13.12-1.tar.gz

保存至/usr目录后解压

tar -xzvf codeblocks_13.12-1.tar.gz
进入目录

cd codeblocks-13.12

  • 编译codeblocks
./bootstrap
./configure --with-contrib-plugins=all
make
make install

后在终端输入codeblocks验证安装是否成功。

3.常见错误

  • $./configure --prefix=/usr --with-contrib-plugins=all
    configure: error:
       wxWidgets must be installed on your system.

解决方法:安装wxidgets,参考步骤1

  • configure: error: Package requirements (hunspell) were not met:

    No package 'hunspell' 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 HUNSPELL_CFLAGS
    and HUNSPELL_LIBS to avoid the need to call pkg-config.
    See the pkg-config man page for more details.
    解决方法:
    sudo apt-cache search hunspell
sudo apt-fast install libhunspell-dev
  • configure: error: Package requirements (gtk+-2.0 >= 2.0.0) were not met:

    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.

解决方法:

sudo apt-fast install libgtk2.0-dev

  • configure: error: Package requirements (gamin) were not met:

    No package 'gamin' found

解决方法:

sudo apt-fast install libgamin-dev

  • configure: error: needed boost headers not found or not usable

解决方法:

sudo apt-fast install libboost-dev

  • 安装完后,若是出现如下错误。"codeblocks:error while loading shared libraries: libcodeblocks.so.0: cannotopen shared object file: No such file or directory"
    则是libcodeblocks.so.0所在的目录没有注册。

sudo gedit /ect/ld.so.conf
添加 /usr/local/lib
sudo ldconfig


























0 0
原创粉丝点击