New Project wizard

The New Project wizard is accessed by selecting File > Open > Project… and it lets you create the following kinds of C or C++ projects:

QNX C Project/QNX C++ Project
A C or C++ project for multiple target platforms. It supports the QNX-specific project structure using common.mk files to perform a QNX recursive make. A QNX project can automatically build either one executable or one library object (in different formats). You can switch which one gets built by configuring the project properties.
Note: As a rule, the IDE provides UI elements to control most of the build properties of QNX projects (see "QNX C/C++ Project properties" for details).
C Project/C++ Project
Depending on your selection in the first screen, the available project types may include:
  • Executable — Provides an executable application. If you specify an Executable template, the workbench creates a project with only the metadata files required for your specific project type. You can write and modify source files as required and provide them for the project's target. For project types under this category, a makefile is created automatically.

    The project type folder includes these two templates:

    • Empty Project — A single source folder that doesn't contain any files.
    • Hello World ANSI C Project/Hello World C++ Project — A basic C or C++ application with main(). The resulting project uses a standard makefile and the GNU make utility for building. You don't get the added functionality of the QNX build organization and the common.mk file, but these projects adapt well to existing code that you bring into the IDE.
  • Shared Library — An executable module compiled and linked separately. When you create an application that uses a shared library, you must define your shared library's project as a Project Reference for your application. For the Shared Library project type, the CDT combines object files so they're relocatable and can be shared by many processes. Shared libraries are named using the format libxx.so.version, where version is a number with a default of 1. The libxx.so file usually is a symbolic link to the latest version. The makefile for this project type is automatically created by the CDT.
  • Static Library — A collection of object files that you can link into an application. The CDT combines object files (*.o) into an archive (libxx.a) that is directly linked into an executable. The makefile for this project type is automatically created by the CDT.
  • Makefile Project — Creates an empty project without any metadata files. This project type is useful for importing and modifying existing makefile-based projects; a new makefile is not created. By default, the Toolchain and templates that currently show up in the lists are based on the language support for the project type that you selected.
Note: The module.dep and module.mk files are created for every project subdirectory. These files are required for Managed Make projects to build successfully.

Wizards for creating QNX projects

In the New Project dialog (which appears after you select File > Open > Project…), the wizards are categorized according to the nature of the project. If you expand C/C++, you see all wizards for creating projects with a C/C++ nature; expand QNX and you see all wizards for creating projects with a QNX nature. Note that there is overlap between the categories; for example, the C Project wizard appears under both C/C++ and QNX.

The IDE also has simple wizards that deal with the basic elements of projects: Project, Folder, and File. These elements have no natures associated with them. You can access these wizards by selecting File > New > Other… > General.

Note:

Although a project may seem to be nothing other than a directory in your workspace, the IDE attaches special meaning to a project — it won't automatically recognize as a project any directory you happen to create in your workspace.

Once you've created a project in the IDE, you can bring new folders and files into your project folder, even if they were created outside of the IDE (e.g., using Windows Explorer).

New Project wizard: QNX C/C++ Project

If you select a QNX C/C++ project, the first panel in the wizard looks like this:

Project name
Name for the QNX project. Although the wizard allows it, don't use any spaces or non-standard characters in your project name. For the full list of unacceptable characters, see Step 4 in "Creating a project for a C or C++ application".
Use default location
Use the current default workspace location to create the new project. If you don't want to use the default location for the project, ensure that the Use Default Location option is deselected, and specify where the resources reside in the filesystem (if they don't reside in your workspace). The Location field is required and must specify a valid location for the project when the Use Default Location is not selected.
Type
Specifies the type for the QNX project:
  • Application — A standalone executable.
  • Shared Library — An executable module compiled and linked separately. For more information about this type, see the first section in this topic.
  • Static Library — A collection of object files that you can link into another application. For more information about this type, see the first section in this topic.
  • Static+Static shared library — From one set of sources, creates a static library libxxx.a and a static library libxxS.a for shared objects (the same as Static library, but it uses position-independent code - PIC).

    Use this type if you want a library that will later be linked into a shared object. The System Builder uses these types of libraries to create new shared libraries that contain only the symbols that are absolutely required by a specific set of programs.

  • Shared library without export — A shared library that you aren't going to link with another application (xx.dll). Instead, it's intended to be manually opened at runtime using the dlopen function, and you can use the dlsym function to look up other specific functions.
Generate default file
Generate default files associated with a project. If you want to check out source from version control, for a QNX project, make sure that you deselect the Generate default file option.
Add project to working sets
Enable this setting to make this project to belong to a working set, so you can group all related projects together as a set. Click Select to either choose an existing working set or create a new one. For more information about working sets, see the Workbench User Guide.

New Project wizard: C++ Project

If you select a C/C++ project, the first panel in the wizard looks like this:

Project name
Name for the QNX project. Although the wizard allows it, don't use any spaces or non-standard characters in your project name. For the full list of unacceptable characters, see Step 4 in "Creating a project for a C or C++ application".
Use default location
Use the current default workspace location to create the new project. If you don't want to use the default location for the project, ensure that the Use Default Location option is deselected, and specify where the resources reside in the filesystem (if they don't reside in your workspace). The Location field is required and must specify a valid location for the project when the Use Default Location is not selected.
Project type
Specifies the type for the QNX project:
  • Executable — Provides an executable application. This project type folder contains three templates:
    • Empty Project — A single-source project folder that doesn't contain any files.
    • Hello World C++ Project — A simple C++ application with main().

    After specifying an Executable template, the workbench creates a project with only the metadata files required for your project type, and automatically creates a makefile for you. You can modify these source files, and provide them for the project's target.

  • Shared Library — An executable module compiled and linked separately. For more information about this type, see the first section in this topic.
  • Static Library — A collection of object files that you can link into another application. For more information about this type, see the first section in this topic.
  • Makefile Project — Creates an empty project without any metadata files. For more information about this type, see the first section in this topic.
Note:

When you create a shared library, its name is recorded in a special dynamic section. You can display the information in this section to see a SONAME record. For example, you can use the following:

ntoarmv7-readelf -d libname.so

When you link against this library, your application will look for that name.

When you perform a make install, the .so is copied to .so.1, and a .so symbolic link is created to point to it. The .so link will get the right version, meaning if you install a .so.2 (where the .so points to it), your old version 1 clients can still run.

Toolchain
Select a required toolchain from the Toolchain list. A toolchain represents the specific tools (such as a compiler, linker, and assembler) used to build your project. Additional tools, such as a debugger, can also be associated with a toolchain. Depending on the compilers installed on your system, there might be several toolchains available to select from.