Creating a project for a C or C++ application

To create a project for writing a C or C++ application:
  1. From the menu, select File > New > Project….
  2. In the New Project wizard, select the project type according to this table:
    If you want to build a: Select:
    C Project C/C++ > C Project
    QNX C Project QNX > QNX C Project
    C++ Project C/C++ > C++ Project
    QNX C++ Project QNX > QNX C++ Project
  3. Click Next.
  4. In the Project name field, type a name for your project.
    Note: Although the wizard allows it, don't use spaces or any of the following characters in your project name:

    | ! $ ( " ) & ` : ; \ ' * ? [ ] # ~ = % < > { }

    These characters cause problems later with compiling and building, because the underlying tools such as make and qcc don't like them in directory and file names.
  5. If you don't want to use the default location for the project, clear the Use Default Location checkbox and specify the path to your project's resources.
  6. Click Next.
  7. Select a type:
    • For a QNX C Project or QNX C++ Project:
      • Application — Create a standalone executable.
      • Static library (libxx.a) — Create a binary object archive that can be linked into an executable.
      • Shared library (libxx.so,libxxS.a) — Combine binary objects so that they are relocatable and can be shared by many processes.
      • Static+Static shared library (libxx.a,libxxS.a) — From one set of sources, create a static library archive libxx.a and a static library for shared objects libxxS.a (the same as a static library, but uses position-independent code (PIC)). Use this type if you want to build 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 (xx.dll) — Generate a shared library that isn't linked with another application but instead is accessed at runtime using the dlopen function with specific functions that are looked up using dlsym.

        If you're building a library, see "Extra libraries" and "Extra library paths".

    • For a C++ Project:
      • Executable — Provides an executable application.

        The project type folder includes these two templates:

        • Empty Project — A single source folder that doesn't contain any files.
        • Hello World C++ Project — A simple C++ application with main().
      • Shared Library — An executable module compiled and linked separately.
      • Static Library — An archive of object files that you can link into another application.
      • Makefile Project — Creates an empty project without any metadata files.

    For more information about any of these types, see "New Project wizard".

    Note:

    When you create a shared library, its name is recorded in a special dynamic section of the binary. 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 file is copied to .so.1, and a .so symbolic link is created to point to it. You'll also notice that .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.

  8. Select a 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 to select from.
  9. Click Next.
  10. In the Basic Settings dialog, you can optionally specify basic properties for the project. When you're finished doing so, click Next to proceed.
  11. In the Select Configurations dialog, choose the types of platforms and configurations you want to deploy this project with.
  12. Optional: Click Advanced Settings... to edit the project's properties.
    1. Expand C/C++ Build and select Settings.
    2. Click the Binary Parsers tab, then select a parser.

      If you select the correct parser for your development environment, you can later build your project and then view the components of the .o file in the Project Explorer view, and view the file's contents in the C/C++ editor.

    3. Click OK.
  13. Click Finish.
    The IDE creates your new project in your workspace. The project is listed in the Project Explorer view. If a message box prompts you to change perspectives, click Yes.
For more information about the tabs shown by the New Project wizard (which depend on the project type you chose), see "Properties for all project types".