codeblocks安装补充

本文详细介绍了在Ubuntu 12.04环境下安装Code::Blocks IDE的过程,包括解决依赖问题如wxWidgets、hunspell等的步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

just introduce *unix environment install steps and notes;
my system environment: ubuntu 12.04
download source code of code::blocks from : codeblocks_12.11-1.tar.gz
$./bootstrap
./bootstrap: 63: ./bootstrap: libtoolize: not found
$sudo apt-fast install libtool -y
$./bootstrap
pass
$./configure --prefix=/usr --with-contrib-plugins=all
configure: error:
                wxWidgets must be installed on your system.

                Please check that wx-config is in path, the directory
                where wxWidgets libraries are installed (returned by
                'wx-config --libs' or 'wx-config --static --libs' command)
                is in LD_LIBRARY_PATH or equivalent variable and
                wxWindows version is 2.8.0 or above.
SOLUTION:
$sudo apt-cache search libwxgtk
libwxgtk2.6-0 - wxWidgets Cross-platform C++ GUI toolkit (GTK+ runtime)
libwxgtk2.6-dbg - wxWidgets Cross-platform C++ GUI toolkit (GTK+ development)
libwxgtk2.6-dev - wxWidgets Cross-platform C++ GUI toolkit (GTK+ development)
libwxgtk2.8-0 - wxWidgets Cross-platform C++ GUI toolkit (GTK+ runtime)
libwxgtk2.8-dbg - wxWidgets Cross-platform C++ GUI toolkit (GTK+ debug)
libwxgtk2.8-dev - wxWidgets Cross-platform C++ GUI toolkit (GTK+ development)

AND it requests version is 2.8.0 or above.
$sudo apt-fast install libwxgtk2.8-dev

-------------retry configure------another problem--------------------
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.
SOLUTION:
$sudo apt-cache search hunspell
hunspell - spell checker and morphological analyzer (program)
hunspell-an - Aragonese dictionary for hunspell
hunspell-ar - Arabic dictionary for hunspell
hunspell-da - Danish dictionary for hunspell
hunspell-de-at - Austrian (German) dictionary for hunspell
hunspell-de-ch - Swiss (German) dictionary for hunspell
hunspell-de-de - German dictionary for hunspell
hunspell-en-ca - English_canadian dictionary for hunspell
hunspell-en-us - English_american dictionary for hunspell
hunspell-eu-es - Basque (Euskera) dictionary for hunspell
hunspell-fr - French dictionary for hunspell
hunspell-gl-es - Galician dictionary for hunspell
hunspell-hu - Hungarian dictionary for hunspell
hunspell-kk - Kazakh dictionary for hunspell
hunspell-ko - Korean dictionary for hunspell
hunspell-ml - Malayalam dictionary for hunspell
hunspell-ne - Nepali dictionary for hunspell
hunspell-ro - Romanian dictionary for hunspell
hunspell-ru - Russian dictionary for hunspell
hunspell-se - North Sámi Hunspell dictionary
hunspell-sh - Serbian (Latin) dictionary for hunspell
hunspell-sr - Serbian (Cyrillic) dictionary for hunspell
hunspell-sv-se - Swedish (SE) dictionary for hunspell
hunspell-tools - tools for hunspell
hunspell-uz - The Uzbek dictionary for Hunspell
hunspell-vi - Vietnamese dictionary for hunspell
libhunspell-1.3-0 - spell checker and morphological analyzer (shared library)
libhunspell-1.3-0-dbg - spell checker and morphological analyzer (debug symbols)
libhunspell-dev - spell checker and morphological analyzer (development)
libreoffice - office productivity suite
myspell-et - Estonian dictionary for MySpell
myspell-lv - Latvian dictionary for Myspell
myspell-nl - Dutch dictionary for Hunspell
myspell-pl - Polish dictionary for myspell
myspell-sv-se - transitional dummy package
goldendict - feature-rich dictionary lookup program
hunspell-de-at-frami - Austrian (German) dictionary for hunspell ("frami" version)
hunspell-de-ch-frami - Swiss (German) dictionary for hunspell ("frami" version)
hunspell-de-de-frami - German dictionary for hunspell ("frami" version)
hunspell-de-med - German medical dictionary for hunspell
libtest-spelling-perl - Perl module for spellchecking pod formatted text
myspell-fr - French dictionary for myspell (Hydro-Quebec version)
myspell-ru - Russian dictionary for MySpell
myspell-tl - Tagalog dictionary for myspell/hunspell
myspell-tools - tools for myspell
omegat - Computer Assisted Translation (CAT) tool
tea - text editor with syntax highlighting & UTF support
--------------------------NOTE---------------------------
we must always focus on what we need! we need hunspell lib not program.
$sudo apt-fast install libhunspell-dev
-------------retry configure------another problem--------------------
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.
------------------------------SULOTION--------------------------------------
$sudo apt-fast install libgtk2.0-dev
-----------------------------STILL-----------------------------------------
configure: error: Package requirements (gamin) were not met:

No package 'gamin' found
-----------------------------sulotion-------------------------------------
sudo apt-fast install libgamin-dev
------------------------boost-----------------------------------
configure: error: needed boost headers not found or not usable
-----------------------solution--------------------------------
sudo apt-fast install libboost-dev
----------------------------NOTE--------------------------------
it's not newest version!

**********************************************************************
if you wanna kown more about this configure options, just read ./BUILD
**********************************************************************

$make

$sudo make install

### 如何在 CodeBlocks 中配置并安装 SDL 库 要在 CodeBlocks 中成功配置并安装 SDL 库,需遵循以下步骤: #### 步骤一:下载必要的资源 访问 SDL 官方网站 [http://www.libsdl.org/](http://www.libsdl.org/) 并导航至下载页面。选择适用于 MinGW 的最新稳定版 SDL 开发包(例如 `SDL2-devel-<version>-mingw.tar.gz`)。将其下载并解压缩到本地磁盘上的某个位置[^2]。 #### 步骤二:创建新的 CodeBlocks 项目 启动 CodeBlocks IDE,依次点击菜单栏中的 **File -> New -> Project...** ,随后从列表中选取 **SDL Application** 类型的模板[^1]。如果未发现此选项,则手动建立一个普通的控制台应用程序稍后再做相应调整也是可行的办法。 对于自定义设置的情况,请继续阅读下一节关于如何将外部库引入现有项目的说明部分[^4]。 --- #### 手动关联已有的普通项目与 SDL 库的方法 假设我们已经有了一个基础框架但尚未集成任何第三方图形处理能力的基础应用软件雏形。现在要把它改造成为支持 SDL 功能的新形态产品线的一员时就需要执行以下几个操作环节了: ##### (A)指定头文件搜索范围 转到 **Project -> Build Options...** 对话框内的 **Search directories** 标签页下方新增加一项条目指向先前提取出来的包含所有公共接口声明语句集合所在的具体物理地址——也就是 `<your_sdl_path>/include/SDL2`[^3]。 ##### (B)告知链接器去哪里寻找目标模块实体副本 同样是在刚才提到过的那个地方再往下拉一点就能看见另一个叫作 **Linker settings** 的区域,在那里追加两条记录分别对应静态档案(.a/.lib)形式存储起来的核心逻辑实现单元的位置信息:<br/> - 对于32位平台而言就是 `<your_sdl_path>/lib/x86` - 而针对64位架构则应选用 `<your_sdl_path>/lib/x64` 接着还要记得补充几个特殊的标志参数进去以便顺利完成整个连接过程,具体来说就是在 **Other linker options** 文本框里面填入 `-lmingw32 -lSDL2main -lSDL2` 这样的序列组合[^2]。 最后一步非常重要却常常被初学者忽略掉的就是要把动态共享对象(`.dll`)复制粘贴到最终生成的应用程序旁边去才行哦!因为只有这样才能保证即使脱离开发环境也能正常运作嘛😊 --- #### 测试验证阶段 完成上述准备工作以后就可以试着敲几行简单的小例子看看效果啦~比如下面这段用来初始化然后又关闭系统的代码片段就是一个不错的选择: ```c++ #include <SDL2/SDL.h> #include <stdio.h> int main(int argc, char* argv[]) { // 初始化 SDL 子系统 if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO) != 0){ fprintf(stderr,"Unable to initialize SDL: %s\n", SDL_GetError()); return -1; } printf("SDL Initialized successfully.\n"); // 关闭 SDL 子系统 SDL_Quit(); printf("SDL Quit Successfully.\n"); return 0; } ``` 假如一切顺利的话,你应该能够在终端窗口里看到类似这样的消息打印出来:“SDL Initialized successfully.” 和 “SDL Quit Successfully.” --- ### 注意事项 遇到诸如无法解析某些符号之类的编译错误时,请仔细检查是否遗漏了某项重要的配置细节或者是版本兼容性方面存在问题所致[^3]。 ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值