Compiling Samples

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
weswitt
Earned a small fee
Earned a small fee
Posts: 24
Joined: Thu Dec 29, 2016 10:45 pm

Compiling Samples

Post by weswitt »

Sorry for the basic question, but I searched and could not find an answer.

What is the procedure for building the sample apps on Linux? Trying this (which seems obvious) fails:

make -f makefile.gcc
if not exist gcc_mswud mkdir gcc_mswud
make: -c: Command not found
makefile.gcc:219: recipe for target 'gcc_mswud' failed
make: [gcc_mswud] Error 127 (ignored)
windres --use-temp-file -i../../samples/sample.rc -ogcc_mswud\display_sample_rc.o --define __WXMSW__ --define _
UNICODE --include-dir .\..\..\lib\gcc_lib\mswud --include-dir ./../../include --include-dir . --include-dir ./../../s
amples --define NOPCH
make: -c: Command not found
makefile.gcc:234: recipe for target 'gcc_mswud\display_sample_rc.o' failed
make: *** [gcc_mswud\display_sample_rc.o] Error 127


I'm using wxWidgets 3.0.4 on Ubuntu Linux.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7479
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Compiling Samples

Post by ONEEYEMAN »

Hi,
Did you build the library yourself or installed it from the repository?

Thank you.
weswitt
Earned a small fee
Earned a small fee
Posts: 24
Joined: Thu Dec 29, 2016 10:45 pm

Re: Compiling Samples

Post by weswitt »

I built it myself. I is correctly built and installed.
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4204
Joined: Sun Jan 03, 2010 5:45 pm

Re: Compiling Samples

Post by PB »

weswitt wrote: Mon Mar 11, 2019 2:30 pm What is the procedure for building the sample apps on Linux? Trying this (which seems obvious) fails:

make -f makefile.gcc
I am MSW only but I believe those makefiles are MSW only? I.e., the makefile for the samples is basically the equivalent of that for the library in WXWIN/build/msw; in fact the samples makefile.gcc actually includes the MSW config.gcc.

Did you try something like described here (using makefile produced by configure)
https://wiki.wxwidgets.org/Compiling_an ... stallation
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7479
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Compiling Samples

Post by ONEEYEMAN »

@PB,
Yes, that's right.
@OP:
How did you build it?

To build the library for *nix you do:

Code: Select all

cd wxWidgets
mkdir buildGTK
cd buildGTK
../configure --enable-debug --with-gtk
make
Then in order to build the samples you do:

Code: Select all

cd samples
make
If you are trying to cross-compile, please show how did you build the library.

Thank you.
weswitt
Earned a small fee
Earned a small fee
Posts: 24
Joined: Thu Dec 29, 2016 10:45 pm

Re: Compiling Samples

Post by weswitt »

Thanks that was it. I have it building now.
mc_alex
In need of some credit
In need of some credit
Posts: 3
Joined: Sun Nov 13, 2022 7:16 pm

Re: Compiling Samples

Post by mc_alex »

I very new to programming and I start to study wxwidgets library and found it very interesting.
I also successfully compiled all files with make like was mentioned above.
I received such files in some directory ../wxWidgets-3.2.0/buildGTK/samples/menu :
- menu_menu.o
- menu (no extension)
- Makefile (no extension)

But what next? How to run that program to see example how it works?
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7479
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Compiling Samples

Post by ONEEYEMAN »

Hi,
Which OS do you have What Window Manager?

You can try to run the sample by opening the default "Files" application under GNOME, navigate to the folder and click on the "menu" file or from the Terminal type "./menu" (no quotes).

Thank you.
mc_alex
In need of some credit
In need of some credit
Posts: 3
Joined: Sun Nov 13, 2022 7:16 pm

Re: Compiling Samples

Post by mc_alex »

Thank you very much, it works from terminal.
I use Linux mint 20.3

Does it possible to change this program to make some executable to run it by mouse click?
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7479
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Compiling Samples

Post by ONEEYEMAN »

Hi,
You don't need to change anything.
Just open the standard Files GNOME application, navigate to that folder and double click the executable.

Thank you.
mc_alex
In need of some credit
In need of some credit
Posts: 3
Joined: Sun Nov 13, 2022 7:16 pm

Re: Compiling Samples

Post by mc_alex »

Strange, but I receive:
"Unknown file type. The file "menu" has no known programs associated with it. Use the Open With dialog to pick a program to open it with"

Properties -> permisions -> "Allow executing file as program" = Enabled.

As file manager Nemo 5.2.4 is used.
Post Reply