[Previous] [Contents] [Next]

Development Environment

Compiler & tools

The compiler used for QNX Neutrino is the GNU compiler (gcc). Currently, development can be done from these hosts:

For MS-Windows hosts, you can use the GNU tools directly or use the CodeWarrior tools from Metrowerks. Currently, the CodeWarrior IDE also uses gcc.

Note that when developing using the GNU compiler, you don't run the compiler directly. Instead, you use a front-end tool called qcc. A minimum compile would look like this:

qcc -V gcc_ntox86 myprogram.c -o myprogram

Header files

Header files reside under ${QNX_TARGET}/usr/include where the value of QNX_TARGET depends on where you're developing from:

Development host: QNX_TARGET:
QNX Neutrino /
MS-Windows c:\opt\QNXsdk\target\qnx6
Solaris /opt/QNXsdk/target/qnx6

Libraries

Libraries that you link against are in ${QNX_TARGET}/${PROCESSOR}/lib.

When migrating from QNX 4, PROCESSOR would most likely be x86.

Static and dynamic libraries

QNX Neutrino supports both static libraries and dynamic libraries. If you link with static libraries, then code from the libraries is inserted into your executable.

Dynamic libraries in QNX Neutrino are the equivalent of shared libraries in QNX 4. In fact, we usually call them shared objects, though many people also know them as DLLs. In the case of dynamic libraries, the code for the library is loaded into memory when the first program that uses that library is run.

Useful manifests

Here are some manifests you may find useful:

#if defined(__WATCOMC__)
    /* Then the program was compiled with Watcom */
#elif defined(__GNUC__)
    /* Then the program was compiled with GCC */
#elif defined(__MWERKS__)
    /* Then the program was compiled with Metrowerks */
#endif

As well, you could do things like:

#if defined(__QNXNTO__)
    /* Then the program was compiled for QNX Neutrino */
#else
    /* Then the program was compiler for QNX 4 */
#endif

Debugging

There are a variety of options that you can use for debugging:

The gdb debugger is a command-line program used in conjunction with the gcc compiler (recall that gcc is the back-end compiler for the qcc command) and is documented in the Utilities Reference.

Buildfiles and images

Image files are conceptually the same as in QNX 4, but structurally very different. There is a sysinit file if you're using QNX Neutrino, but there isn't one by default on your target. The buildfile language has been expanded to include primitive scripting.

For more information, see the chapter on "Making an OS Image" in the Building Embedded Systems book in the Embedding SDK package, as well as the documentation on the mkifs utility.


[Previous] [Contents] [Next]