Building wxGTK
wxGTK installation
Prerequisites
You'll need the GTK development package for your platform (e.g. libgtk2.0-dev)
Getting wxGTK
Browse to the wxWidgets download page. Under wxWidgets 2.8.7 downloads, select wxGTK. Save the file in ~/devel.
Uncompressing the wxGTK sources
After the download finishes, switch to ~/devel:
cd ~/devel
Now, untar the wxGTK sources:
tar zxf wxGTK-2.8.7.tar.gz
Switch to the wxGTK directory:
cd wxGTK-2.8.7
wxWidgets build
Here we will create a seperate build directory instead of building from the src directory, so that we can easily rebuild with different options (unicode / ansi, monolithic / many libs, etc).
wxFormBuilder uses the unicode monolithic library, so pass the flags to configure.
mkdir build_gtk2_shared_monolithic_unicode cd build_gtk2_shared_monolithic_unicode ../configure --prefix=/opt/wx/2.8.7 --enable-xrc --enable-monolithic --enable-unicode make
You need to be root to finish so run one of the following two commands, depending on your platform.
su
or
sudo -s
Install the libraries.
make install
Add /opt/wx/2.8.7/lib to /etc/ld.so.conf (nano /etc/ld.so.conf) then run:
ldconfig
Log out of root.
exit
That's it. Now the linker will look in /opt/wx/2.8.7/lib for wx libraries and you will have a monolithic shared library unicode build.
Setting up wx-config
wxFormBuilder relies heavily on a tool called wx-config to build. This allows the build process to use whichever build of wxWidgets you have installed.
In addition to the libraries, make install installed wx-config for you. You just need to make sure it is working.
On debian systems, you'll need to add it to the alternatives system so that it plays nice with versions of wxWidgets installed from the package manager. If you are on a debian based system (this includes Ubuntu), run this command:
sudo update-alternatives --install /usr/bin/wx-config wx-config /opt/wx/2.8.7/bin/wx-config 287
On other systems, you can just add /opt/wx/2.8.7/bin to your PATH (there may be a better way that I do not know of).
If you're shell is bash then edit /etc/profile or ~/.bash_profile. On Suse 10.1 edit /etc/profile.local. It might only be available after a new login. An example PATH
export PATH=/usr/bin:/opt/wx/2.8.7/bin:$PATH
To check that things are working, type:
wx-config --prefix
which should give you /opt/wx/2.8.7
On debian based systems
which wx-config
should return /usr/bin/wx-config and
update-alternatives --list wx-config
should show /opt/wx/2.8.7/bin/wx-config as the alternative in use.
On other systems
which wx-config
should return /opt/wx/2.8.7/bin/wx-config
Also see make sure wx-config is working before attempting to build wxFormBuilder.