Search code examples
c++ubuntugccwxwidgets

Error message when building WxWidgets sample program


I was trying to follow the instructions here to setup WxWidgets.

I've managed to run the commands wx-config --version and wx-config --list but not the commands to compile the minimal example, which are:

cd gtk-build/samples/minimal make ./minimal

After lots of display messages I arrive at:

/usr/bin/ld: cannot find -lwxtiff-3.1
/usr/bin/ld: cannot find -lwxjpeg-3.1
/usr/bin/ld: cannot find -lwxregexu-3.1
collect2: error: ld returned 1 exit status
make: *** [minimal] Error 1
Makefile:149: recipe for target 'minimal' failed
The command '/bin/sh -c make' returned a non-zero code: 2

Did I miss the installation of some library?

There is a similar question for windows here, but the answers there seem not to apply for linux.


Solution

  • First of all, please look at the official instructions rather than the wiki which may, or not, be up to date.

    Second, by running make clean you removed the libraries used by the in-tree makefiles. So, unsurprisingly, you can't use them any more, but you can use makefile.unx from the source tree, i.e. if wx-config is in your PATH, just use make -f makefile.unx in $wx/samples/minimal (and not under gtk-build/samples/minimal).