2018-10-03 13:16:39 -04:00
|
|
|
wxWidgets for Qt installation {#plat_qt_install}
|
2014-08-23 21:50:11 -04:00
|
|
|
-----------------------------
|
|
|
|
|
2018-10-03 13:16:39 -04:00
|
|
|
[TOC]
|
|
|
|
|
2014-08-23 21:50:11 -04:00
|
|
|
IMPORTANT NOTE:
|
|
|
|
|
|
|
|
If you experience problems installing, please re-read these
|
|
|
|
instructions and other related files (todo.txt, bugs.txt and
|
|
|
|
osname.txt for your platform if it exists) carefully before
|
|
|
|
mailing wxwin-users or the author. Preferably, try to fix the
|
|
|
|
problem first and then send a patch to the author.
|
|
|
|
|
|
|
|
When sending bug reports tell us what version of wxWidgets you are
|
|
|
|
using (including the beta) and what compiler on what system. One
|
|
|
|
example: wxQt 3.1.0, GCC 4.8.1, Ubuntu 14.04
|
|
|
|
|
2018-10-03 13:16:39 -04:00
|
|
|
Installation {#qt_install}
|
|
|
|
============
|
|
|
|
|
|
|
|
The simplest case {#qt_simple}
|
2014-08-23 21:50:11 -04:00
|
|
|
-------------------
|
|
|
|
|
|
|
|
If you compile wxWidgets on Linux for the first time and don't like to read
|
|
|
|
install instructions just do (in the base dir):
|
|
|
|
|
2018-10-03 13:16:39 -04:00
|
|
|
> mkdir buildqt
|
|
|
|
> cd buildqt
|
|
|
|
> ../configure --with-qt
|
|
|
|
> make
|
|
|
|
> su <type root password>
|
|
|
|
> make install
|
|
|
|
> ldconfig
|
|
|
|
|
2014-08-23 21:50:11 -04:00
|
|
|
[if you get "ldconfig: command not found", try using "/sbin/ldconfig"]
|
|
|
|
|
|
|
|
If you don't do the 'make install' part, you can still use the libraries from
|
|
|
|
the buildgtk directory, but they may not be available to other users.
|
|
|
|
|
|
|
|
If you want to remove wxWidgets on Unix you can do this:
|
|
|
|
|
2018-10-03 13:16:39 -04:00
|
|
|
> su <type root password>
|
|
|
|
> make uninstall
|
|
|
|
> ldconfig
|
2014-08-23 21:50:11 -04:00
|
|
|
|
2018-10-03 13:16:39 -04:00
|
|
|
The simplest errors {#qt_error_simple}
|
2014-08-23 21:50:11 -04:00
|
|
|
---------------------
|
|
|
|
|
|
|
|
For any configure errors: please look at config.log file which was generated
|
|
|
|
during configure run, it usually contains some useful information.
|
|
|
|
|
2018-10-03 13:16:39 -04:00
|
|
|
configure reports, that you don't have Qt installed although you are very
|
2014-08-23 21:50:11 -04:00
|
|
|
sure you have. Well, you have installed it, but you also have another
|
2018-10-03 13:16:39 -04:00
|
|
|
version of the Qt installed, which you may need to remove. Or maybe you
|
|
|
|
installed it in a non-default location and configure can't find it there,
|
|
|
|
so please check that your PATH variable includes the path to the correct
|
|
|
|
qtconfig/pkg-config. Also check that your LD_LIBRARY_PATH or equivalent
|
|
|
|
variable contains the path to Qt libraries if they were installed in a
|
2014-08-23 21:50:11 -04:00
|
|
|
non-default location.
|
|
|
|
|
2018-10-03 13:16:39 -04:00
|
|
|
The simplest program {#qt_simple_app}
|
2014-08-23 21:50:11 -04:00
|
|
|
----------------------
|
|
|
|
|
|
|
|
Now create your super-application myfoo.cpp and compile anywhere with
|
|
|
|
|
2018-10-03 13:16:39 -04:00
|
|
|
g++ myfoo.cpp `wx-config --libs --cxxflags` -o myfoo
|
2014-08-23 21:50:11 -04:00
|
|
|
|
2018-10-03 13:16:39 -04:00
|
|
|
GUI libraries {#qt_libs_ui}
|
2014-08-23 21:50:11 -04:00
|
|
|
---------------
|
|
|
|
|
|
|
|
wxWidgets/Qt requires the Qt library to be installed on your system. It has
|
|
|
|
to be a stable version, preferably Qt 5.2.1 or later.
|
|
|
|
|
2018-10-03 13:16:39 -04:00
|
|
|
Building wxQT on Ubuntu {#qt_build_ubuntu}
|
2014-08-23 21:50:11 -04:00
|
|
|
-------------------------
|
|
|
|
|
|
|
|
Install latest Qt5 packages (qt5-default). To build unit tests, libcppunit-dev
|
|
|
|
is required. You will need to install other dependencies to compile wxWidgets
|
2018-10-03 13:16:39 -04:00
|
|
|
depending on the features you'll want to use (build-essential libjpeg-dev
|
2014-08-23 21:50:11 -04:00
|
|
|
libtiff5-dev ubuntu-restricted-extras freeglut3 freeglut3-dev libsdl1.2-dev
|
|
|
|
libgstreamer-plugins-base0.10-dev)
|
|
|
|
|
|
|
|
|
|
|
|
Then create a build directory, configure and compile:
|
|
|
|
|
2018-10-03 13:16:39 -04:00
|
|
|
mkdir bldqt5
|
|
|
|
cd bldqt5
|
|
|
|
../configure --with-qt --enable-debug
|
|
|
|
make
|
|
|
|
make samples
|
2014-08-23 21:50:11 -04:00
|
|
|
|
|
|
|
If everything is ok, you can do the make install as specified before.
|
|
|
|
|
|
|
|
Optionally, you can build and run Unit Tests:
|
|
|
|
|
2018-10-03 13:16:39 -04:00
|
|
|
cd tests
|
|
|
|
make
|
|
|
|
./test_gui
|
2014-08-23 21:50:11 -04:00
|
|
|
|
2018-10-03 13:16:39 -04:00
|
|
|
Building wxQT, using qt-unified-XXX-online installer {#qt_build}
|
2018-06-24 12:46:58 -04:00
|
|
|
------------------------------------------------------
|
|
|
|
|
|
|
|
Download qt-unified-XXX-online installer from the qt website.
|
|
|
|
Install the Qt package of your choice (with the same minimum version
|
|
|
|
restriction as above).
|
|
|
|
The same build instructions apply, except that you need to explicitly pass
|
|
|
|
to configure the Qt dir of the build intended to use as QT5_CUSTOM_DIR, i.e.
|
|
|
|
|
2018-10-03 13:16:39 -04:00
|
|
|
for Linux:
|
2018-06-24 12:46:58 -04:00
|
|
|
|
2018-10-03 13:16:39 -04:00
|
|
|
../configure --with-qt --enable-debug QT5_CUSTOM_DIR=~/Qt/5.11.0/gcc_64
|
2018-06-24 12:46:58 -04:00
|
|
|
|
2018-10-03 13:16:39 -04:00
|
|
|
for Windows (ran from Git Bash, or any other Unix-like shell):
|
|
|
|
(the syntax for the drive in the path is required by ar and ld)
|
|
|
|
|
|
|
|
../configure --with-qt --enable-debug QT5_CUSTOM_DIR=c:/Qt/5.11.0/mingw53_32
|
|
|
|
|
|
|
|
Building wxGT on Android {#qt_android}
|
2014-08-23 21:50:11 -04:00
|
|
|
--------------------------
|
|
|
|
|
|
|
|
Download Android Native Development Kit (NDK), tandalone Android Software
|
|
|
|
Development Kit (SDK), install them and perform the following instructions to
|
|
|
|
prepare the cross-compilation tool-chain to (change NDK and other paths):
|
|
|
|
|
2018-10-03 13:16:39 -04:00
|
|
|
NDK=~/src/android-ndk-r9d
|
|
|
|
SDK=~/src/android-sdk-linux
|
|
|
|
export ANDROID_NDK_ROOT=$NDK
|
|
|
|
$NDK/build/tools/make-standalone-toolchain.sh \
|
|
|
|
--toolchain=arm-linux-androideabi-4.8 --platform=android-9 \
|
|
|
|
--install-dir=/tmp/ndk
|
2014-08-23 21:50:11 -04:00
|
|
|
|
2018-10-03 13:16:39 -04:00
|
|
|
export PATH=/tmp/ndk/bin:$PATH
|
|
|
|
export CC=arm-linux-androideabi-gcc
|
|
|
|
export CXX=arm-linux-androideabi-g++
|
2014-08-23 21:50:11 -04:00
|
|
|
|
|
|
|
|
|
|
|
Also, you'll need to download the Qt library bundle that matches your operating
|
2018-10-03 13:16:39 -04:00
|
|
|
system installed package (5.2.1 in this case installed in ~/src/qt, you'll need
|
2014-08-23 21:50:11 -04:00
|
|
|
the android_armv5/ android_armv7/ android_x86/ pre-compiled folders to
|
|
|
|
cross-compile for that architectures)
|
|
|
|
|
2018-10-03 13:16:39 -04:00
|
|
|
Then, create a build directory (under the wxWidgets folder), configure for
|
2020-06-28 09:26:36 -04:00
|
|
|
Android (disable currently unsupported/unneeded features) and run make:
|
2014-08-23 21:50:11 -04:00
|
|
|
|
2018-10-03 13:16:39 -04:00
|
|
|
cd ~/src/wxWidgets
|
|
|
|
mkdir bldqt5droid
|
|
|
|
cd bldqt5droid
|
|
|
|
../configure --with-qt --enable-debug --build=x86_64-unknown-linux-gnu \
|
|
|
|
--host=arm-linux-androideabi --disable-compat28 --disable-shared \
|
|
|
|
--disable-arttango --enable-image --disable-dragimage --disable-sockets \
|
|
|
|
--with-libtiff=no --without-opengl --disable-baseevtloop --disable-utf8
|
|
|
|
make
|
2014-08-23 21:50:11 -04:00
|
|
|
|
|
|
|
You can now compile and link your app against this build, and finally
|
|
|
|
package it for Android using standard APK tools.
|
|
|
|
|
2018-10-03 13:16:39 -04:00
|
|
|
Create your configuration {#qt_config}
|
2014-08-23 21:50:11 -04:00
|
|
|
---------------------------
|
|
|
|
|
|
|
|
Usage:
|
2018-10-03 13:16:39 -04:00
|
|
|
|
2014-08-23 21:50:11 -04:00
|
|
|
./configure options
|
|
|
|
|
|
|
|
If you want to use system's C and C++ compiler,
|
|
|
|
set environment variables CC and CXX as
|
|
|
|
|
|
|
|
% setenv CC cc
|
|
|
|
% setenv CXX CC
|
|
|
|
% ./configure [options]
|
|
|
|
|
|
|
|
to see all the options please use:
|
|
|
|
|
|
|
|
./configure --help
|
|
|
|
|
|
|
|
It is recommended to build wxWidgets in another directory (maybe a
|
|
|
|
subdirectory of your wxWidgets installation) as this allows you to
|
|
|
|
have multiple configurations (for example, debug and release or GTK
|
|
|
|
and Motif) simultaneously.
|
|
|
|
|
2018-10-03 13:16:39 -04:00
|
|
|
Feature Options {#qt_feature_options}
|
2014-08-23 21:50:11 -04:00
|
|
|
-----------------
|
|
|
|
|
|
|
|
When producing an executable that is linked statically with wxQt
|
|
|
|
you'll be surprised at its immense size. This can sometimes be
|
|
|
|
drastically reduced by removing features from wxWidgets that
|
2018-10-03 13:16:39 -04:00
|
|
|
are not used in your program.
|
2014-08-23 21:50:11 -04:00
|
|
|
|
|
|
|
Please see the output of "./configure --help" for comprehensive list
|
|
|
|
of all configurable options.
|
|
|
|
|
|
|
|
Apart from disabling certain features you can very often "strip"
|
|
|
|
the program of its debugging information resulting in a significant
|
|
|
|
reduction in size.
|