C::B(Code::Blocks) の導入メモ。
コンパイラ(MinGW)付き
codeblocks-1.0rc2_mingw.exeコンパイラ無し
codeblocks-1.0rc2.exe
CB_30jan2006_rev1906_win32_.7z wxmsw26u_gcc_cb.7z
CentOS 4.2 の場合
「Build/wxPropertyGrid」を行う。
※但しC::BはUnicode版でのみ動作する。またSTLを使用しているとビルド出来ないので下記のオプションを指定する事。
# ./configure \ --with-gtk \ --with-opengl \ --with-sdl \ --enable-controls \ --enable-monolithic \ --enable-tabdialog \ --disable-stl \ --disable-std_iostreams \ --disable-std_string \ --enable-unicode
# cd /usr/local/src
codeblocks-1.0-rc2.src.rpm
って安易にやってみてもエラーが出てうまくいかない。
# rpmbuild --rebuild codeblocks-1.0-rc2.src.rpm
codeblocks-1.0rc2.tgz
# tar zxf codeblocks-1.0rc2.tgz
# cd codeblocks-1.0rc2
パッケージのファイルの改行コードは全て CR+LF であり、そのままでは支障があるので「dos2unix」コマンドで LF に変換する。
# find ./ -name "*" \ -type f \ -not -name "*.bmp" \ -not -name "*.cur" \ -not -name "*.dll" \ -not -name "*.ico" \ -not -name "*.png" \ -not -name "*.svg" \ -not -name "*.url" \ -not -name "*.xpm" \ -exec dos2unix -k {} \;
# sh bootstrap
# ./configure
# make # make install
# codeblocks起動直後に下記のエラーメッセージが出る。
No handler found for XML node 'object', class 'wxToolBarAddOn'!とりあえず無視して構わない。forumの情報(wxToolBarAddOnで検索)では
Well, 1.0rc2 is old by now (almost 4 months). Many bugs have been fixed since then. I 'd recommend you build C::B from source. It's easier than you would think. If you use RC2, the plugins should be obsolete by now...と今までやった事は全て無駄だった・・・orz
因みにMakefileが無くてもビルド出来る模様。
下記のように修正する。
(変更前)
-Winvalic-pch -include "wx_pch.h" `wx-config -cflags`(変更後)
`wx-config -cflags`
下記の定義を削除する。
USE_PCH
Unicode版のwxWidgetsを利用している場合、C::Bが自動生成したコードがUnicode対応になっていない部分("" => _("") or wxT(""))があるので、注意が必要。
ブレークポイント貼っても止まらないし、デバッガが起動してなさそう・・・。
項目 | 設定/情報 |
OS | CentOS 4.2 |
echo $LANG | ja_JP.UTF-8 |
wxWidgets | GTKベースのwxGTKを使用 |
wxGTKのバージョン | 2.6.2 |
wxPropertyGridのバージョン | - *1 |
C::Bのリビジョン | r2264 |
インストール先 | /usr/local |
OSに付属するものはVer1.1.4とちと古いので、Dag Wieers(理研ミラー)のバージョンを入れておく方が良い。
# yum install subversion
「Build/wxPropertyGrid」を行う。
※但しC::BはUnicode版でのみ動作する。またSTLを使用しているとビルド出来ないので下記のオプションを指定する事。
# ./configure \ --with-gtk \ --with-opengl \ --with-sdl \ --enable-controls \ --enable-monolithic \ --enable-tabdialog \ --disable-stl \ --disable-std_iostreams \ --disable-std_string \ --enable-unicode
# /usr/local/include/wx-2.6/wx
C::Bは自分で wxPropertyGrid のソースコードを内包し、staticリンクするように構成されている。
よってビルド環境に wxPropertyGrid が含まれているとビルドエラーとなる。
# cd `wx-config --prefix`/include/wx-2.6/wx # mv propgrid propgrid.tmp
# /usr/local/src
# mkdir CodeBlocksSVN # cd CodeBlocksSVN
2006/02/08現在、頻繁にソースコードの更新があるので、ソースコードの取得は日本時間の昼間に行った方がビルドが通り易い鴨。
SubversionのProxy設定
# vi ~/.subversion/serversCheckOutの実行
# svn checkout https://svn.berlios.de/svnroot/repos/codeblocks/trunk
# cd trunk
# ln -s /usr/local/share/aclocal/wxwin.m4 /usr/share/aclocal
# ./bootstrap
# ./configure
# make # make install
# cd `wx-config --prefix`/include/wx-2.6/wx # mv propgrid.tmp propgrid
# vi /usr/local/bin/codeblocks.shファイル内容
#!/bin/sh export LANG=ja_JP.eucJP /usr/local/bin/codeblocksファイルのパーミッションの設定
# chmod ugo+x /usr/local/bin/codeblocks.sh
# codeblocks.sh