wx-config --cxxflags and a new install

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
philjynx
Earned some good credits
Earned some good credits
Posts: 137
Joined: Tue Mar 06, 2018 6:00 pm

wx-config --cxxflags and a new install

Post by philjynx »

In trying to resolve some issues with building wxFormBuilder, I have followed the instructions and installed from here http://codelite.org/LiteEditor/WxWidgets30Binaries

That created /usr/local/wx-3.0-unofficial/wx and put the header files in there (I renamed that to '/usr/local/wx-3.0/wx'- which I believe is where they should be.
It also created /usr/lib/wx/config/gtk2-unicode-3.0-unofficial & /usr/lib/wx/config/base-unicode-3.0-unofficial, these I have not renamed.

Problem is, wx-config --cxxflags returns this:

Code: Select all

  -I/usr/local/lib/wx/include/gtk3-unicode-static-3.0 -I/usr/local/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -pthread

And wx-config --libs returns this:

Code: Select all

-L/usr/local/lib -pthread   /usr/local/lib/libwx_gtk3u_xrc-3.0.a /usr/local/lib/libwx_gtk3u_qa-3.0.a /usr/local/lib/libwx_baseu_net-3.0.a /usr/local/lib/libwx_gtk3u_html-3.0.a /usr/local/lib/libwx_gtk3u_adv-3.0.a /usr/local/lib/libwx_gtk3u_core-3.0.a /usr/local/lib/libwx_baseu_xml-3.0.a /usr/local/lib/libwx_baseu-3.0.a -lgthread-2.0 -pthread -lX11 -lXxf86vm -lSM -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lpng -lexpat -lwxregexu-3.0 -lwxtiff-3.0 -lwxjpeg-3.0 -lz -ldl -lm 
Am I missing something here? Although I have installed that package (as described in the link above), is there more that I have to do so that it gets noticed?

I am a novice at Linux, wx-widgets.

I have a long history of writing (last ice-age) Clipper applications, and a lot of experience with Object pascal (in the guise of Delphi), So, I am not as stupid as I may well appear here!
DavidHart
Site Admin
Site Admin
Posts: 4252
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: wx-config --cxxflags and a new install

Post by DavidHart »

Hi,
I have followed the instructions and installed from here http://codelite.org/LiteEditor/WxWidgets30Binaries
Which distro (and its version) are you using? Which package did you install? Did you do a standard (for your distro) install of it or something unusual? I ask because those packages should install to /usr/, not /usr/local/.
(I renamed that to '/usr/local/wx-3.0/wx'- which I believe is where they should be
Don't do that! It's likely to break things. Correctly installed, the package should 'just work'.
Problem is, wx-config --cxxflags returns this:...
You presumably have another install, and that's what wx-config is pointing at. Or, more accurately, that's what the first wx-config found in your $PATH is pointing at.
Am I missing something here? Although I have installed that package (as described in the link above), is there more that I have to do so that it gets noticed?
How you fix this is in part distro-specific. Most distros (openSUSE is one exception) come with an update-alternatives package (install it if it's not already there) that knows about wx-config. So the official way to change which wx installation is used is to do, as root or with sudo:

Code: Select all

#> update-alternatives --config wx-config
and then follow the instructions.
Alternatively you can fiddle with your PATH. In the terminal that you're about to use to build the program, do:
PATH=/full/path/to/a/particular/wx-config:$PATH
Invoking wx-config should then point to the correct wx install.
Or in an IDE, or in a terminal for that matter, you can use the full path to a particular install. So instead of writing wx-config in the compiler/linker settings, you write /full/path/to/a/particular/wx-config each time.

Regards,

David
philjynx
Earned some good credits
Earned some good credits
Posts: 137
Joined: Tue Mar 06, 2018 6:00 pm

Re: wx-config --cxxflags and a new install

Post by philjynx »

Thank you for your reply
The distro I used was

Code: Select all

sudo apt-add-repository 'deb http://repos.codelite.org/wx3.0.4/ubuntu/ artful universe'
I managed to mis-quote where it had put things.
The two paths it installed to are:

/usr/lib/wx/config
/usr/include/wx-3.0-unofficial/wx

I tried this (to see what would happen).

Code: Select all

phil@phil-Veriton-N280G ~ $ /usr/lib/wx/config/gtk2-unicode-3.0-unofficial --cxxflags
-I/usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0-unofficial -I/usr/include/wx-3.0-unofficial -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread
And this:

Code: Select all

phil@phil-Veriton-N280G ~ $ echo $path

phil@phil-Veriton-N280G ~ $ 
Notice the absence of any output.

Now this:

Code: Select all

phil@phil-Veriton-N280G ~ $ PATH=/usr/lib/wx/config/gtk2-unicode-3.0-unofficial:$PATH
phil@phil-Veriton-N280G ~ $ echo $path

phil@phil-Veriton-N280G ~ $ 
Make any sense of that?
I had previously built wx-widgets from source, it is no doubt that install which currently gets returned by wx-config.
DavidHart
Site Admin
Site Admin
Posts: 4252
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: wx-config --cxxflags and a new install

Post by DavidHart »

echo $path
That would work on Windows; but Linux is case-sensitive. Try echo $PATH

Also, what is the output of doing, in a terminal:
which wx-config

And what happens if you do:
sudo update-alternatives --config wx-config
Assuming it's installed, that should list the all the wx installs that it knows about. What does it show, and which is currently selected?
If it's the wrong one for you, it lets you change it.
philjynx
Earned some good credits
Earned some good credits
Posts: 137
Joined: Tue Mar 06, 2018 6:00 pm

Re: wx-config --cxxflags and a new install

Post by philjynx »

Hmmm, forgot about the case sensetive thing.
There seem to be a lot of duplicates in the path.....

Code: Select all

phil@phil-Veriton-N280G ~ $ PATH=/usr/lib/wx/config/gtk2-unicode-3.0-unofficial:$PATH
phil@phil-Veriton-N280G ~ $ echo $PATH
/usr/lib/wx/config/gtk2-unicode-3.0-unofficial:/home/phil/bin:/home/phil/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
phil@phil-Veriton-N280G ~ $ which wx-config
/usr/local/bin/wx-config
phil@phil-Veriton-N280G ~ $ sudo update-alternatives --config wx-config
[sudo] password for phil: 
There are 2 choices for the alternative wx-config (providing /usr/bin/wx-config).

  Selection    Path                                            Priority   Status
------------------------------------------------------------
  0            /usr/lib/wx/config/gtk2-unicode-3.0-unofficial   308       auto mode
* 1            /usr/lib/wx/config/base-unicode-3.0-unofficial   307       manual mode
  2            /usr/lib/wx/config/gtk2-unicode-3.0-unofficial   308       manual mode

Press <enter> to keep the current choice[*], or type selection number: 

DavidHart
Site Admin
Site Admin
Posts: 4252
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: wx-config --cxxflags and a new install

Post by DavidHart »

There seem to be a lot of duplicates in the path.....
There often are. It's not important.

So update-alternatives knows about the target wx install. However you have the 'base' version selected atm. You need to type '2' and Enter.
Then if you do
wx-config --list
and wx-config --cxxflags --libs
in a terminal you should get sane results.
philjynx
Earned some good credits
Earned some good credits
Posts: 137
Joined: Tue Mar 06, 2018 6:00 pm

Re: wx-config --cxxflags and a new install

Post by philjynx »

That's starting to look promising.
If I hadn't mentioned it, I had been trying to build wxFormBuilder from source.
The build was complaining about all manner of (wxBlahDiBlah) things not being declared, so I foolishly assumed my exWidgets was to blame, hence the recent antics. One thing in particular that formbuilder was moaing about was the absence of mediactrl, so I built wxWidgets with --enable-mediactrl. Didn't help as the current source for formbuilder is missing some files, the folder /wxFormBuilder-master/sdk/tinyxml/ is empty! So, you can't build it without copying them from an earlier source (no mean feat to find that). I have those files, but have not done this copy, instead, (for now) I have built formbuilder without mediactrl support as I have, just in the last few minutes, discovered there's a switch for building exFormBuilder without mediactrl

Code: Select all

create_build_files4 --disable-mediactrl  
Thanks to your brilliant advice, I've now got the correct wxWidgets configuration up and running and have just, FINALLY, built wxFormBuilder, it even launches and appears to function!

I do not know what the mediactrls is (vidio stuff, I guess). My intention is to make a GUI interface for the RPi in the MIDI controller that I've built (it uses the RPi to handle usb-midi connections and a teensy to handle all the lights and switches and the two expression pedals - yes, believe it or not, that all works! Then the RPi can be used to configure the settings for the devices this MIDI controller is connected to and also display stuff like patch names that are currently in use on those devices. In case that is of any interest, the two devices are a Roland GR55 guitar synth and a Boss Katana amplifier. Both are non-class compliant usb-midi devices, hence the RPi and ALSA come to the rescue. Right now all the config in that black box (it is, actually, black) are hard coded in the teensy sketch.

Thanks very much for your help, I doubt I would have figured this out for myself, it would be like looking around in an atic, in the dark without a torch and not even knowing what I was looking for.

One last question, can mediactrl be enabled somehow (in wxWidgets, without re-installing wxWidgets? I should have asked this first, you may have got bored by now....
DavidHart
Site Admin
Site Admin
Posts: 4252
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: wx-config --cxxflags and a new install

Post by DavidHart »

I do not know what the mediactrls is
See http://docs.wxwidgets.org/stable/classw ... _ctrl.html.
One last question, can mediactrl be enabled somehow
Open a terminal and do:

Code: Select all

ls /usr/lib/x86_64-linux-gnu/libwx_gtk2u_unofficial_media-3.0.so.0.4.0
I think you'll find it's there, in which case you already have a working mediactrl.
philjynx
Earned some good credits
Earned some good credits
Posts: 137
Joined: Tue Mar 06, 2018 6:00 pm

Re: wx-config --cxxflags and a new install

Post by philjynx »

Thanks, after all that effort to build wxFormBuilder, I finally found there was absolutely no need to.
I finally found this (somewhere on the interweb)

Code: Select all

sudo add-apt-repository -y ppa:wxformbuilder/release
sudo apt-get update
sudo apt-get install wxformbuilder
Incidentally, there's no sign of any media controls (like video) in the palette on this wxFormBuilder, but at this point I don't care as my intended RPi interface will not need such things.

Then a tiny bit of effort to add it to the Programming menu.

Shame it is often so difficult to find out how to install stuff on linux.

I am now able to design the UI with that and build a simple test program.

The challenge now is to organised cross-building it for the RPi.
Again, thanks for all your help.
Post Reply