Linker tab

The Linker tab fields change depending on your selection in the Category dropdown list at the top:

General options

Generate map file
When set, the IDE prints a link map to the build console.
Stack size
Define the stack size, in bytes or kilobytes.
Export symbol options
Define the level of final stripping for your binary, ranging from exporting all symbols, to removing only the debugger symbols, to removing all symbols.
Build goal name
Specify the output filename for the application or library. Defining a name in this field forces the library's shared-object name to match.

By default, a generated application has the same name as the project it's built from. A library has a prefix of lib and a suffix of .a or .so after the project name. In addition, debug variants of applications and libraries have a suffix of _g.

Link against CPP library
(for QNX C++ projects only)
Select the particular C++ library you want to use. QNX Momentics Tool Suite currently ships with these C++ libraries:
  • Default — The standard QNX C++ library, with support for all standard C++ features (exceptions, STL, etc.).
  • Dinkum with exceptions and Dinkum without exceptions — The Dinkum C++ library, with support for exceptions or without.
  • GNU with exceptions — The GNU G++ Standard Library, with support for exceptions.
Note: Compiling C++ code without support for exceptions usually results in a faster executable.
Library shared object name
(for build target types that generate a shared object (.so) library file)

Override the shared-object name used in C/C++ library projects. This setting doesn't affect the actual filename.

Note: If you specify a filename in Build goal name, don't use the Library shared object name field.
Library version
(for build target types that generate a shared object (.so) library file)

Select a version number for both the library's shared-object name and filename.

Note: If you specify a filename in Build goal name, you can still set the Library version field.

If the library doesn't have a version number (e.g., its filename is to be libxx.so with no numeric suffix), select No. This way, the shared-object name isn't hard-coded in the library.

To use versioning, you can leave the field setting as Default, in which case the IDE uses 1 as the version number, or select an exact version number within the available range. The filename is then libxx.so.n, where n is a number based on this setting. In this case, the shared-object name ends with so.n. The loader requires the library filename to be exactly like this because all dependent projects will refer to the library as so.n (in the NEEDED section of the executable).

If you use the IDE to upload libraries to the target when launching an application, the IDE silently renames each library file to the proper version, and makes a copy in the host directory so that the host tools (e.g., the debugger) can find it as well.

Other options
Specify any other command-line options that aren't already covered on the Linker tab. For more information about the linker's options, see the entry for ld in the Utilities Reference.
The content that you type in this field appears in the Linker options box below.
Note:

When a shared library is created, its name is documented in a special dynamic section of the library's binary file. When you link against the library, your application looks for that name.

When you run make install, the .so file is copied to .so.1, and a .so symbolic link is created to point to it. You'll notice that the .so gets the right version. If you install a .so.2 (where the .so points to it), your old version 1 clients can still run.

Extra library paths

Select this category to modify the list of library paths to specify locations where the linker should look for import libraries (.so or .a files) and to change the order in which they are referenced.

Library directory expression
Shows the list of directory expressions for the library paths you specified.
Project…
Add a library project path by browsing your workspace for the library. When you add a library from your workspace, the IDE uses a relocatable notation so that other members with different workspace locations can all work successfully without having to make any project adjustments.
QNX target…
Add a library path from an existing QNX target.
Disk…
Add a library path from anywhere in the filesystem.
Delete
Remove the selected library path reference from the list of library directory expressions.
Up
Change the order by moving the currently selected library path up in the list. Libraries are processed in the order in which they appear in the list. If a static library references symbols defined in another static library, the library containing the reference must be listed before the library containing the definition. If you have cross references or circular references, you might not be able to satisfy this requirement.
Down
Change the order by moving the currently selected library path down in the list.

Extra libraries

By selecting this category, you can define a list of libraries (.so or .a files) to search for unsatisfied references.

For each item in this list, you can define:
  • Name — the base name, without the lib prefix (which ld adds automatically) or the suffix (.so or .a).
  • Type — the library type. This field is optional because you can let the linker find the first available type. But you can manually set the type by clicking this table entry and the arrow that appears, and then selecting one these items from the dropdown list:
    • Static
    • Dynamic
    • Stat+Dyn
    • Dyn+Stat
  • Use proper variant — A No or Yes field that indicates whether the builder matches the debug or release version of the library with the final binary's type. (You set this field in the same way as Type.)

    For example, if you select Yes and you want to link against a debug version of the library, the IDE appends _g to the library's base name. If you select No, the builder passes (to ld) the specified name, exactly as you entered it. Therefore, if you want to use a release version of your binary and link against a debug version of the library, specify Yes for debug.

    Note that setting this value appears to create errors with the library names in the common.mk file; however, the qnx_internal.mk included with common.mk corrects this problem.

Note: Adding an item to the extra library list automatically adds the directory where this library resides to the Extra library paths list, provided that its path isn't already in the list. However, if you remove an item from the list, its parent directory is not automatically removed.

You can add a library in three ways:

Add
Add a library by creating an empty element, which allows you to define it manually.
Project…
Add a library project by browsing your workspace for the library. When you add a library from your workspace, the IDE uses a relocatable notation so other members with different workspace locations can all work successfully without having to make any project adjustments.
QNX target…
Add a library from an existing QNX target.

The remaining buttons are:

Delete
Remove the selected library from the list of extra libraries. The library isn't deleted from the host system; only from the list.
Up
Change the order by moving the currently selected library up in the list. Libraries are processed in the order in which they appear in the list. If a static library references symbols defined in another static library, the library containing the reference must be listed before the library containing the definition. If you have cross references or circular references, you might not be able to satisfy this requirement.
Down
Change the order by moving the currently selected library down in the list.

Extra object files

This category lets you link a project against any object file or library, regardless of the filename.

Note:

The file selection dialog may seem slow when adding new files. This is because the system can't make assumptions about naming conventions and instead must inspect a file to determine if it's an object file or library.

The Extra object files option is available for an individual platform only. If a project has more than one active platform, you can't use this feature. In that case, you can still specify extra object files using the advanced mode for each platform separately.

Extra objects or libraries
Shows the list of directory expressions for the objects or libraries you specified.
Project…
Add a library or object by browsing your workspace. When you add a library or object from your workspace, the IDE uses a relocatable notation so that other members with different workspace locations can all work successfully without having to make any project adjustments.
QNX target…
Add a library or object from an existing QNX target.
Disk…
Add a library or object from the entire filesystem.
Delete
Remove the selected library or object from the list of extra library or object references.
Up
Change the order by moving the currently selected library or object up in the list. Objects are processed in the order in which they appear in the list.
Down
Change the order by moving the currently selected library or object down in the list.

Post-build actions

Select this category to specify a list of commands to apply (sequentially, in the order given) after building your project.

The buttons let you add and delete actions and move them up and down in the list. If you click Add, the resulting dialog provides radio buttons that let you choose one of these actions:

Depending on the action selected, additional fields in this second dialog let you specify what you want to copy or move, the destination (in your workspace or filesystem), the new name, and the shell command.