RAD Studio (Common)
ContentsIndex
PreviousUpNext
Compiling, Building, and Running Applications

As you develop your application in the IDE, you can compile (or make), build, and run the application in the IDE. All three operations can produce an executable (such as .exe, .dll, .obj, or .bpl). However, the three operations differ slightly in behavior:

  • Compile (ProjectCompile) or, for C++, Make ( ProjectMake) compiles only those files that have changed since the last build as well as any files that depend on them. Compiling or making does not execute the application (see Run).
  • Build (ProjectBuild) compiles all of the source code in the current project, regardless of whether any source code has changed. Building is useful when you are unsure which files have changed, or if you have changed project or compiler options.
  • Run (RunRun (F9) compiles any changed source code and, if the compile is successful, executes your application, allowing you to use and test it in the IDE .
To delete all the generated files from a previous build, use the Clean command, available on the context menu of the project node in the Project Manager.

You can set many of the compiler options for a project by choosing ProjectOptions and selecting a compiler-related page. For example, most of the options on both the Delphi Delphi Compiler page and the C++ Compiler page correspond to compiler options that are described in the online Help for that page.  

To specify additional compiler options, you can invoke the compiler from the command line. For a complete list of the Delphi compiler options and information about running the Delphi compiler from the command line, see Delphi Language Guide in the Contents pane.  

 

To display the current compiler options in the Messages window each time you compile your project, choose ToolsOptionsEnvironment Options and select Show command line. The next time you compile a project, the Messages window displays the command used to compile the project and the response file. The response file lists the compiler options and the files to be compiled. 

After you compile a project, you can display information about it by choosing ProjectInformation. The resulting Information dialog box displays the number of lines of source code compiled, the byte size of your code and data, the stack and file sizes, and the compile status of the project.

As you compile a project, compiler messages are displayed in the Messages window. For an explanation of a message, select the message and press F1.

You can save certain project options as a named build configuration. You can specify the active build configuration for each of your projects, and you can change the active build configuration during project development. For example, you can set project options specific to debugging your project, save the options as the Debug build configuration, and then apply them as the active configuration while you debug the project. 

The options in a build configuration are available on the Compiler, Compiler Messages, Linker, and Conditionals/Directories pages of the ProjectOptions dialog box.  

By default, the IDE includes a Debug configuration and a Release configuration. You can modify the options in both of these default configurations, and you can create new build configurations of your own. To apply a selected build configuration to specific projects or project groups, use the Build Configuration Manager.

When you explicitly build a project, the IDE calls MSBuild, the Microsoft build engine. The build process is entirely transparent to developers. MSBuild is called as part of the Compile,Build, and Run commands available on the Project and Run menus. However, you can also invoke MSBuild.exe from the command line or using the MSBuild Console available on the Start menu.

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!