[Previous]
[Contents]
[Next]

Development Environment

Compiler & tools

The compiler used for 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 frontend tool called qcc. A minimum compile would look like this:

qcc -V gcc_ntox86 myprogram.c -o myprogram

Header files

Header files reside under ${QSSL_TARGET}/include where QSSL_TARGET is usually /usr/nto if you're developing from Neutrino or from QNX 4. If you're developing from MS-Windows, it's: C:\Program Files\Metrowerks\QNX\Neutrino\usr\nto

Libraries

Libraries that you link against are in ${QSSL_TARGET}/${PROCESSOR}/lib where QSSL_TARGET is, again, usually /usr/nto or C:\Program Files\Metrowerks\QNX\Neutrino\usr\nto.

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

Static and dynamic libraries

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

Dynamic libraries are the equivalent of shared libraries in QNX 4. In fact, we usually call them shared objects in Neutrino, 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

Debugging is accomplished either by using gdb or the Metrowerks IDE debugger, which is covered in the CodeWarrior document Targeting QNX Neutrino.

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 Development Tools book.

Buildfiles and images

Image files are conceptually the same as in QNX 4, but structurally very different. There is no sysinit file, but the buildfile language has been expanded to include primitive scripting.

For more information, see the chapter on "Making a Neutrino Image" in the Building Embedded Systems book as well as the documentation on the mkifs utility.


[Previous]
[Contents]
[Next]