Compile a project

Now that you've created your first application, you need to compile and link the code.

To compile and link your BlackBerry PlayBook OS project:
  1. Open the C/C++ perspective by choosing its icon in the right side of the toolbar.
  2. To create a binary, right-click the project name, and then select Build Project.
    The compiler and linker will now do their work.

    If you want to build for the simulator, right-click on the project and select Build Configurations > Set Active > Simulator. If you want to build for the device, right-click on the project and select Build Configurations > Set Active > Device-Debug or Device-Release. Makefile projects build all build variants by default.
    You will find the compiler output (including any errors), in the Console view. For example:

    **** Rebuild of configuration Simulator for project MyBlackBerryProject ****
                                
    **** Internal Builder is used for build               ****
    qcc -o src\main.o ..\src\main.c -V4.4.2,gcc_ntox86 -w1 -c -g
    qcc -o MyBlackBerryProject src\main.o -lGLESv1_CM -lEGL -lscreen -V4.4.2,gcc_ntox86 -w1 -g
    Build complete for project MyBlackBerryProject
    Time consumed: 5188  ms.

    However, if errors occur during compiling, you will find the Problems view more useful, because it displays the output of the compiler in an interpreted and more readable fashion than the Console view:

    The Editor view also gives you information about an error if you leave the pointer over it.

After the build operation, your binaries will be displayed in the Binaries folder in Project Explorer. Physically, for Makefile projects, they're located in the CPU directory under o (for object) and o-g (where -g is the debug option passed to the compiler).