Next Previous Table of Contents

### 10. Crosscompiling

### 10.1 Setup

To crosscompile your application, you usually have to pass the parameters --target=, --host= and --build= to the configure script. When using the crosscompiler to create a binary for the target, you should create a customized compile configuration in your project options. Before you can actually start with compiling, you need to:

- make sure your crosscompilers are installed
- make sure the binaries of the crosscompilers are in your PATH environment variable (e.g. put export PATH=/opt/cross/bin:$PATH into .bashrc on SuSE Linux systems)
- configure KDevelop to use the crosscompilers in the KDevelop setup
- select the target architecture in the Project options dialog after you added a new configuration.

### 10.2 Qt/Embedded

To use Qt/Embedded, pass --enable-embedded to the configure options in your configuration. Additionally, you will need to set the path to your Qt/Embedded directory in the same dialog. When crosscompiling to e.g. arm, make sure you have Qt/Embedded crosscompiled and in a separate directory. Then set this directory as the Qt directory in the configure options, and again pass --enable-embedded. However, you will not be able to test a crosscompiled version, therefore you should have a natively compiled version installed to test your applications with. Use the program qvfb to run your applications in. In case the application doesn't start up, pass the -qws parameter to the Run with Arguments command.

### 10.3 Qt Palmtop Enviroment

You can also compile your application for use with the Qt Palmtop Environment that is used on handheld computers such as the Sharp or the Compaq iPaq. Crosscompile the Qt Palmtop sources and create a native version. Make sure the libqpe.so is present and in your LD_LIBRARY_PATH, so that you can run the QPE in the qvfb. To turn your application into a QPE application, use the QPEApplication class which is declared in the qpeapplication.h include file in qpe/library. Make sure your include line (-I) contains the qpe/library directory or copy the q*.h files from qpe/library to your qt-embedded/include directory.

Further, pass the parameter --enable-palmtop to the configure script of the configuration that you want to use for Qt/Embedded and QPE. That will add the -lqpe linker flag dynamically as a substitute for the $(LIB_QPE) macro in the linker flags. If you have trouble with linking to -lqpe, the first place to check is if your project options->linker settings dialog contains $(LIB_QPE) in the additional libraries line; if not, set it there and run configure again, then call make or run.

Crosscompiling should work as with Qt/Embedded; so just select the target architecture in the project options dialog for the according configuration.

Next Previous Table of Contents