wxWidgets installation


12 posts
by cbegg50 » Wed Jun 20, 2012 10:43 pm
I'm trying to compile a program that requires wxWidgets. I've downloaded the wdWidgets source, but it requires X11 includes and libraries which I can't find. How can this be if Raspberry Pi uses X11 (startx). Where can I get the X11 libraries used and the relevant include files?

Regards,
Colin Begg
Posts: 15
Joined: Sat Jun 16, 2012 10:32 pm
by Alec » Wed Jun 27, 2012 9:48 am
Hmm, I expect to want to explore this later myself. Perhaps later/other OS pi distros will come w/ the requrired headers, and libraries compiled for the platform. As for the startx question, could the answer be that that that the xinit program that the startx script invokes is built without needing all of the libs required for wxWidgets? And/or these are used statically linked?

If you don't get any joy here or on another forum on this site, it might be, of course be worth asking on the wxWidgets users' ML. (wx-users)

Good Luck.
Posts: 22
Joined: Sat Jan 14, 2012 8:18 pm
by cbegg50 » Wed Jun 27, 2012 11:18 am
Hi,
Upon further investigation, I have found the libraries and includes in extended library paths and include paths like /usr/lib/arm-linux-gnueabi, but there's is a sub-folder called pkgconfig, which contains some .pc files as required for compilation of wxWidgets and other programs requiring glib, pango, atk or GTK, but only a few of these .pc files are actually in the folder.

I have posted separately about these missing .pc files, but essentially the distro is missing some files required to make use (in newly compiled programs) of these libraries. I'm attempting to generate the required files from Gnome project sources, then copy them to the distro's pkgconfig folder and I'll report here on my success/failure and include any working files I create.

Regards,
Colin Begg
Posts: 15
Joined: Sat Jun 16, 2012 10:32 pm
by molton » Thu Jan 03, 2013 4:14 am
Hello, I'm interested in buying Raspberry Pi's for some projects I have in mind, but I would have to be able to use wxWidgets on the Raspberry Pi, has anyone had any luck with getting wxwidgets to work? What OS did you try Cbegg?
Posts: 8
Joined: Thu Jan 03, 2013 4:09 am
by NormanDunbar » Mon Jan 07, 2013 8:46 am
molton wrote:Hello, I'm interested in buying Raspberry Pi's for some projects I have in mind, but I would have to be able to use wxWidgets on the Raspberry Pi, has anyone had any luck with getting wxwidgets to work? What OS did you try Cbegg?


I have wxWidgets running on my Pi using wxPython. As far as I remember, I did this:

sudo apt-get update
sudo apt-get install python-wxgtk2.8 python-wxglade

I use wxGlade to design my GUIs.

The dependencies for python-wxgtk2.8 should bring in all you need.

HTH

Cheers,
Norm.
Why do they put lightning conductors on churches?
User avatar
Posts: 73
Joined: Wed Nov 23, 2011 12:13 pm
Location: Leeds, West Yorkshire, England.
by molton » Mon Jan 07, 2013 2:29 pm
Thanks Norman, what OS do you use on that Raspberry Pi?
Posts: 8
Joined: Thu Jan 03, 2013 4:09 am
by NormanDunbar » Mon Jan 07, 2013 8:28 pm
Evening.

I'm using Raspbian. It's currently the only one using hardwarefloating point rather than software. Plus, I much prefer it to Fedora and/or Arch. I tried all of them and settled on Raspbian.

Cheers,
Norm.
Why do they put lightning conductors on churches?
User avatar
Posts: 73
Joined: Wed Nov 23, 2011 12:13 pm
Location: Leeds, West Yorkshire, England.
by ghans » Mon Jan 07, 2013 9:42 pm
Could it be that OP is just missing the development
versions of the packages ? I.E. the "-dev" ones ?


ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org
Posts: 5550
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany
by molton » Tue Jan 08, 2013 10:30 am
Thanks again Norman. It could be that OP just didn't get it working, but I know I'm putting that Raspian on my Raspberry Pi when I get one because of this thread. I'm interested in putting my program Lightput onto Raspberry Pi computers to make animated dichroic glass artwork and a Raspberry PI is so small the computer could be integrated into the art piece.
Posts: 8
Joined: Thu Jan 03, 2013 4:09 am
by molton » Tue Feb 05, 2013 12:21 pm
fyi, I guess because the X-11 implementation in the Raspbian is slow right now (I heard that somewhere) wxWidgets apps run kinda slow on the Raspberry Pi, but they work. One thing I noticed is code dealing with the file system had to be changed around to work right for some reason, I had to use the wxStandardPaths.GetExecutablePath()
Posts: 8
Joined: Thu Jan 03, 2013 4:09 am
by Alec » Wed Feb 20, 2013 6:36 pm
Sorry, I should have posted back my success in building wxWidgets 2.9.4 on the last version of Raspbian. I followed pretty much the procedure below; and I've started again w/ the current Raspbian (13-02-09). (I say pretty much, because I'm not certain of the libs/version numbers that I used before.)

I installed: - build-essential
- libgtk2.0-dev
- libgnomeprintui2.2-dev

Then, (w/ unnecessary sudo)

cd /home/pi/wxWidgets-2.9.4
sudo mkdir build
cd build
sudo ../configure
sudo make
cd samples/minimal
sudo make
./minimal

the minimal, and a few other samples that I tried all worked fine.

The basic build of wxWidgets took ~5.5hr tho. ;-(

A couple of related points: I've started threads on the C/C++ fora on speeding up build perfromance using g++; and on-cross compilation options.

Also, IIRC, Raspbian comes w/ wxGTK in the repo but this is the (now ancient) 2.8.0 version.

So far I've not built any demanding wxWidgets apps, on the Pi - and certainly none that would stretch the real-time or graphics capabilities.
Posts: 22
Joined: Sat Jan 14, 2012 8:18 pm
by AlfredoMeraz » Fri Jan 09, 2015 8:26 pm
Following Alec steps, after:
apt-get install libgnomeprintui2.2-dev
you can:
apt-get install libwxgtk2.8-dev
and it will install the library with headers and everything needed to compile your apps. Version 2.8.12 will be installed.
`wx-config --cppflags` will give you the flags needed to compile and `wx-config --libs` the libraries needed to link.
The only thing to be careful, at least in my case, is that the build is Unicode, whereas the original 2.8 windows build is not Unicode by default. That caused me a minor headache, as my sources were not unicode aware. I know it's silly, but since I'd been with wxwidgets since the days when it was wxWindows, and long before unicode appeared in the wx world, I needed a way to test my installation and my older apps wouldn't compile with the unicode change, so I disabled unicode all together as a test. Then, kept it disabled because of all the details to take care of with strings and chars seemed pointless. Now I'm porting everything to unicode.
On the very plus side, the library is just as strong as it gets. My test app, one running already in windows, runs just the same in the Raspberry, other than at lower speed, nothing annoying at all.
And it is not a "minimal" app at all. It uses network sockets, a personal protocol, has a lot of controls, including richtext with fonts and colors, a panel to draw several graphics and text, and the app flow enables/disables some controls and everything works as expected. The only thing the application doesn't have is menus, because since the beggining it was conceived to be ported to an iPad. Again, since the protocol was ASCII based, I had to be careful with moving the data between unicode and ascii for it to work properly.
In short, I can truly say that I can build at least a complex application in windows, take the source, compile it and run it in the Raspberry without hassles. I see this as a business oppotunity.
Regards.
Alfredo Meraz
Posts: 1
Joined: Fri Jan 09, 2015 7:28 pm