toge's diary

コンピュータ関連の趣味をつらつらと。

Ubuntu8.10でwx-configが見つからない

Ubuntu8.10でwxWidgetsのプログラムをつくろうとしたら、wx-configがなくて右往左往する。
wx-commonにあるんじゃないかぁと思ってたんだけど、そこにはない。

同じこと考える人がいて、質問してくれていました。

https://bugs.launchpad.net/ubuntu/+source/wxwidgets2.8/+bug/303663

libwxbase2.8-devをインストールした自動生成されるらしい。

いそいそとインストールしたら、次はこんなエラーメッセージに苛まされる

% g++ -c `wx-config --cflags` hello.cpp
/usr/include/wx-2.8/wx/cursor.h: In constructor ‘wxBusyCursorSuspender::wxBusyCursorSuspe
nder()’:
/usr/include/wx-2.8/wx/cursor.h:65: error: ‘wxIsBusy’ was not declared in this scope
/usr/include/wx-2.8/wx/cursor.h:67: error: ‘wxBusyCursor’ has not been declared
/usr/include/wx-2.8/wx/cursor.h: In destructor ‘wxBusyCursorSuspender::~wxBusyCursorSuspe
nder()’:
/usr/include/wx-2.8/wx/cursor.h:72: error: ‘wxIsBusy’ was not declared in this scope
/usr/include/wx-2.8/wx/cursor.h:74: error: ‘wxBusyCursor’ has not been declared
/usr/include/wx-2.8/wx/region.h: In member function ‘bool wxRegionBase::Intersect(const w
xRect&)’:
/usr/include/wx-2.8/wx/region.h:251: error: invalid use of undefined type ‘struct wxRegio
n’
/usr/include/wx-2.8/wx/gdicmn.h:38: error: forward declaration of ‘struct wxRegion’
/usr/include/wx-2.8/wx/region.h: In member function ‘bool wxRegionBase::Subtract(const wx
Rect&)’:
/usr/include/wx-2.8/wx/region.h:256: error: invalid use of undefined type ‘struct wxRegio
n’
/usr/include/wx-2.8/wx/gdicmn.h:38: error: forward declaration of ‘struct wxRegion’
/usr/include/wx-2.8/wx/region.h: In member function ‘bool wxRegionBase::Xor(const wxRect&
)’:
/usr/include/wx-2.8/wx/region.h:261: error: invalid use of undefined type ‘struct wxRegio
n’
/usr/include/wx-2.8/wx/gdicmn.h:38: error: forward declaration of ‘struct wxRegion’

これはここに回避方法が書いてあった。

http://forums.codeblocks.org/index.php?topic=6831.msg52421

% sudo update-alternatives --config wx-config

`wx-config' を提供する 2 個の alternatives があります。

  選択肢       alternative
-----------------------------------------------
*         1    /usr/lib/wx/config/base-unicode-release-2.8
 +        2    /usr/lib/wx/config/gtk2-unicode-release-2.8

デフォルト[*] のままにするには Enter、さもなければ選択肢の番号のキーを押してください: 2
Using '/usr/lib/wx/config/gtk2-unicode-release-2.8' to provide 'wx-config'.

これで問題なくビルド出来るようになった。
なんかwxWdigets関連のパッケージは沢山入れなくちゃいけなくて大変だなぁ。