[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9. Compilation/Build

This chapter describes how to compile files, build executables and run them. Most capabilities can be accessed through the Build menu item, or through the Build and Run contextual menu items, as described in the following section.

When compiler messages are detected by GPS, an entry is added in the Locations tree, allowing you to easily navigate through the compiler messages (see 2.8 The Locations Tree), or even to automatically correct some errors or warnings (see 13.3 Code Fixing).

9.1 The Build Menu  


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.1 The Build Menu

The build menu gives access to capabilities related to checking, parsing and compiling files, as well as creating and running executables.

Check Syntax
Check the syntax of the current source file. Display an error message in the Messages window if no file is currently selected.

Compile File
Compile the current file. Display an error message in the Messages window if no file is selected.

If errors or warnings occur during the compilation, the corresponding locations will appear in the Locations Tree. If the corresponding Preference is set, the source lines will be highlighted in the editors (see 15.1 The Preferences Dialog). To remove the highlighting on these lines, remove the files from the Locations Tree.

Make
main
For each main source file defined in your top level project, an entry is listed to build (compile, bind, link) this source file. Similarly the Build contextual menu accessible from a project entity contains the same entries.

Compile all sources
Compile all source files defined in the currently selected project, or by default the top level project.

All
Build and link all main units defined in your project. If no main unit is specified in your project, build all files defined in your project and subprojects recursively. For a library project file, compile sources and recreate the library when needed.

<current file>
Consider the currently selected file as a main file, and build it.

Custom...
Display a text entry where you can enter any external command. This menu is very useful when you already have existing build scripts, make files, ... and want to invoke them from GPS.

Recompute C/C++ Xref info
Recompute the cross-reference information for C and C++ source files. See section 6.1 Support for Cross-References.

Run
main
For each main source file defined in your top level project, an entry is listed to run the executable associated with this main file. Running an application will first open a dialog where you can specify command line arguments to your application, if needed. You can also specify whether the application should be run within GPS (the default), or using an external terminal.

When running an application from GPS, a new execution window is added in the bottom area where input and output of the application is handled. This window is never closed automatically, even when the application terminates, so that you can still have access to the application's output. If you explicitly close an execution window while an application is still running, a dialog window will be displayed to confirm whether the application should be terminated.

When using an external terminal, GPS launches an external terminal utility that will take care of the execution and input/output of your application. This external utility can be configured in the preferences dialog (Helpers->Execute command).

Similarly, the Run contextual menu accessible from a project entity contains the same entries.

Custom...
Similar to the entry above, except that you can run any arbitrary executable.

Interrupt
Interrupt the current compilation or build.


[ << ] [ >> ]           [Top] [Contents] [Index] [ ? ]

This document was generated by Mail Server on November, 29 2004 using texi2html