Dr. Martin Ettl‎ > ‎Tutorials‎ > ‎

How to activate sound on Ubuntu 12.x with wxWidgets - 2.8.x ?

As Open Sound System (OSS) is not any longer part of recent Ubuntu (12.04) version, the sound in wxWidgets based applications is broken. This bug is already confirmed by the Ubuntu developers, but until   a working update is available, a solution is presented here.


First of all, the wxWidgets library has to be installed. This can be done by the the apt-command:

$ sudo apt-get install libwxgtk2.8-dev

Now, the sound can be tested by compiling and executing the wxsoundcheck sample, which is available on github.
After downloading, it can be compiled and executed with following commands:

 $ cd wxsoundcheck/make
 $ make build

After compiling the wxsoundcheck, the application can be started with:
$ ../bin/wxsoundcheck

Then you can select between different sounds and methods, the sound is played:

If you hear a sound, you can stop reading and you know your sound is working well with wxWidgets.
Of you do not hear a sound, follow the instructions below to bring sound back on your Ubuntu.

First of all the the previously installed wxWidgets-library has to be removed. This can be done by following apt-command:

$ sudo apt-get remove libwxgtk-2.8-dev

In the next step, the libsdl package must be installed. This package brings the sound support back.

$ sudo apt-get install libsdl-sound1.2-dev

Then, the sources of the current stable version of wxWidgets have to be download from
http://www.wxwidgets.org/downloads/#latest_stable

After that, the following steps have to be done on the terminal.

$ cd /path/to/wxGTK-2.8.xx

adapt path as needed

$ mkdir gtk-build

$ cd gtk-build
Then create a new build folder. This allows many parallel wxWidgets builds for example to realize separated versions for debugging and release management, or to use Unicode and an ANSI code or as static and shared implementation, etc.

Then call configure as

$ ../configure --enable-unicode --with-sdl

If it stops because of a missing package, install it (needed packages mostly have the extension -dev) and run configure again. When it stops successfully without errors, you are ready for building with

$ make

After all components have been compiled, the following overview should be given ( Note: sdl must have the value yes!):

On Ubunut systems, start the installation with:

$ sudo make install (e.g. on Ubuntu, enter password if requested)

or on other Linux distributions


$ su root


$ make install

After then the wxWidgets installation is located at /usr/local/


In order to run all wxwidgets applications with this library, add the following line to your .basrc -file:
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib/

Further reading: