先去http://www.wxwidgets.org/downloads/上下载最新版本的wxWidgets,下载ALL,那里面包含所有的.
参考资料:
http://www.codeproject.com/useritems/Linux.asp
http://www.codeproject.com/library/wxwidgets.asp
1 tar xvf wxWidgets-2.8.8.tar.bz2
2 cd ./wxWidgets-2.8.4
3 ./configure --with-gtk -disable-shared
4 make
5 su <type root password>
6 make install
7 ldconfig
安装完了以后可以测试一下
# wx-config --version
2.8.4
如果需要卸载wiWidgets,
>cd wxGTK-2.6.3
>su <type root password>
>make uninstall
>ldconfig
注意:如果gcc版本在3.3以下(gcc -v查看),需要下载并安装wxWidgets-2.6.3-Patch-2.tar.gz,否则make通不过;或者升级gcc
(2)检查安装是否成功:
> wx-config --cxx
正常情况下输出g++,否则,follow me,
> cd /usr/local/bin
> ls wx-config (看看是否存在)
如果存在,请将/usr/local/bin加入用户PATH变量中
如果不存在,follow me,
> ln -s /usr/local/lib/wx/config/gtk2-ansi-release-2.6 wx-config
最后,在编译的时候,可能会出现以下情况,如
g++ hworld.cpp 'wx-config --libs --cxxflags' -o hworld
g++: wx-config --libs --cxxflags : No such file or directory
这时,你可以试试这样,
g++ hworld.cpp $(wx-config --libs --cxxflags) -o hworld