[Previous] [Contents] [Next]

Caution: This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs.

Development Environment

Compiler & tools

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

If you have the QNX Momentics Professional Edition, you can develop using the Integrated Development Environment (IDE) from any host. Alternatively, you can use command-line tools that are based on the GNU compiler.

If you have the QNX Momentics Standard Edition, you have only the command-line tools available.

For MS-Windows hosts, you also have the option of getting 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 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 doing your development.

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]