To create a project for writing a C or C++ application:
-
From the menu, select .
- In the New Project wizard, select the project type according to this table:
If you want to build a: |
Select: |
C Project |
|
QNX C Project |
|
C++ Project |
|
QNX C++ Project |
|
- Click Next.
-
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.
-
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.
- Click Next.
- 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:
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.
- 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.
- Click Next.
-
In the Basic Settings dialog, you can optionally specify basic properties for the project.
When you're finished doing so, click Next to proceed.
-
In the Select Configurations dialog, choose the types of platforms and configurations you want
to deploy this project with.
- Optional:
Click Advanced Settings... to edit the project's properties.
- Expand C/C++ Build and select
Settings.
- 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.
- Click OK.
-
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".