Search code examples
c++linuxbuildwxwidgets

How do you build wxWidgets samples on linux


I have recently downloaded wxWidgets (installed from source but I don't think that is the problem) and I cannot figure out how to build the samples provided on linux. From what I can tell all the makefiles given are for windows machines and from the few things I have found online just say to run make in the directory but that just leaves me with a

make: *** No targets specified and no makefile found. Stop.

I have no idea how to build them. The particular samples I am trying to build can be found here: https://github.com/wxWidgets/wxWidgets/tree/WX_3_0_BRANCH/samples/minimal

and I am using wxwidgets version: 3.0.5, Ubuntu: 20.04 ,if any other information is needed please just ask

Not too sure if I'm just missing something for what, any help would be great, thanks

EDIT: I have tried to build them also using make -f makefile.gcc and get this error:

if not exist gcc_mswud mkdir gcc_mswud
make: -c: Command not found
make: [makefile.gcc:219: gcc_mswud] Error 127 (ignored)
windres --use-temp-file -i../../samples/sample.rc -ogcc_mswud\minimal_sample_rc.o    --define __WXMSW__       --define _UNICODE  --include-dir .\..\..\lib\gcc_lib\mswud --include-dir ./../../include  --include-dir .  --include-dir ./../../samples --define NOPCH
make: -c: Command not found
make: *** [makefile.gcc:234: gcc_mswud\minimal_sample_rc.o] Error 127

but from what I can gather this is because that makefile is meant for windows machines


Solution

  • You need to run the configure script to generate the make files for your system. There is a good article on this on the wiki. The configure script will produce make files for both the library and the samples.

    On linux, this 2 step configure/make process is quite common for building libraries and programs.