Problem building wxWidgets on aarch64 (ubuntu)

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
seventil
In need of some credit
In need of some credit
Posts: 2
Joined: Thu Aug 24, 2017 11:38 am

Problem building wxWidgets on aarch64 (ubuntu)

Post by seventil »

Hello everyone, I was looking for a nice way to make GUI for embedded linux devices. I tried to use wxWidgets and ran into some troubles. I'll describe everything I did to get started with wxWidgets so that in case if I solved some problem in a wrong way, you could point it out.
I'm programming in Code::Blocks C++ on my amd64 desktop PC with Ubuntu 16.04. The device, that I want my applications to work on is Ordroid C2, that is a Cortex-A53 (aarch64) one, that runs Ubuntu 16.04 as well. For cross-compiling I use Linaro 6.3.1 x86_64-aarch64 toolchain.
Making a console application in Code::Blocks, building it using this toolchain - it works perfectly on my odroid. When I try to build a wxWidgets empty project, linker gives an error: skipping incompatible wx libraries and cant find compatible ones. As I found out it happens, because I need libraries for aarch64, not the amd64 ones, that were installed on my desktop. That means I need to install them on my aarch64 platform. Have to compile wxWidgets from source code, here I go two ways: 1) cross compile it on my desktop and 2) compile it native. Both this ways run into a problem, that is true for wxWidgets 2.8, 3.0 and 3.1: configure files (config.sub, config.guess downloaded with source code from wxWidgets downloads page) are outdated and don't know about aarch64 existence. Error message from 3.1 version suggested to take this files from git and gave a url, so I did.
When doing native, configure starts working, until it runs into a problem: checking for GTK+ >=2.6.0 fails (attachments 2. Bash configure log and 3. config.log). This error was solved for everyone on the internet by installing libgtk2.0-dev, but I already have it. Purged, installed back, no effect. Tried to install libgtk-3-dev, no effect. Tried to set the path to libs into LD_LIBRARY_PATH, or giving -l<path> to cflags or cxxflags with ./configure, it doesnt help. I looked into config log, tried to understand what error is happening, and googled how to resolve, but was unable to apply what I found to this situation. It happens with wxWidgets 2.8, 3.0 and 3.1. (undefined reference to pcre_study in libglib-2.0)
When doing cross-compiling, configure goes well. But after make command, errors appear. First one was about not having x11/Xlib.h, so I installed the package for arm64, and it worked. Got stuck on the second one (attachment 4. Bash cross log.txt).
Googled a solution, every answer I found suggests that when you get a "cast from void to int looses permission" error, you should use 'uintptr_t', to avoid it. Which is used. And the mistake is in the toolchain file, that looks weird.
Help me please build wxWidgets for aarch64.
Attachments
4. Bash cross log.txt
(4.47 KiB) Downloaded 80 times
3. config.log.txt
(119.68 KiB) Downloaded 78 times
2. Bash configure log.txt
(8.93 KiB) Downloaded 75 times
DavidHart
Site Admin
Site Admin
Posts: 4252
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: Problem building wxWidgets on aarch64 (ubuntu)

Post by DavidHart »

Hi,

I've no experience with aarch64 or arm64, but for recent ubuntu versions I see that the latter is now used for your device.
so I installed the package for arm64, and it worked
That sounds promising. Have you tried installing the arm64 xenial libwxgtk3.0-dev package (plus dependencies of course)? If that works, you won't need to build wx yourself.

Otherwise, I'm afraid I have no idea why you're getting those configure errors.

Regards,

David
seventil
In need of some credit
In need of some credit
Posts: 2
Joined: Thu Aug 24, 2017 11:38 am

Re: Problem building wxWidgets on aarch64 (ubuntu)

Post by seventil »

That's a reply for anyone, who had run into the same problem.
Tried different things to do this, the following worked perfectly:
found wxwidgets3.0 deb arm64 packages and installed them to my odroid c2 with dependencies. Used sshfs to mount sysroot of odroid to my desktop, after that I took wx-config --libs and wx-config --cxxflags outputs with modified paths (add path to sysroot on my desktop system) and written it to my compiler settings. After that had also to give a linker paths to all the libs, that wx libs depend on, and thats it. Successful compilation, and application runs on my odroid.
Thanks for help, DavidHart. For some reason I thought that if there are no packages for arm64 in the downloads page of wxwidgets website, they do not exist #-o
Post Reply