Sun Visual WorkShop C++ Overview

Chapter 2 Building and Compiling

With Sun Visual WorkShop C++, you can build and compile your programs efficiently, starting with the use of a single graphical interface as a control panel.

Program in an Integrated Environment

With Sun Visual WorkShop C++, you can manage and execute a complete suite of development tools through a single graphical user interface.

Since developers tend to have their favorite editors, Sun WorkShop offers three of the most popular: vi, Emacs, and XEmacs. When using Sun WorkShop, you can choose your editor from the Text Editor Options dialog box.

Simplify Building With Sun WorkShop Building Window

Your makefile describes explicitly how to build each module of your program as well as the final executable. Sun WorkShop Building is a graphical interface to the UNIX make utility, the utility that oversees program compilation and ensures that your programs are compiled from the newest sources. After you initiate a program build in the Building window, the build process reads the makefile for the program and executes the commands it finds there.

Use Building to expand the makefile rules and macros, increase productivity, and reduce errors. Sun WorkShop Building gives you the following advantages over issuing make commands from the command line:

Improve Performance With the C++ Compiler

Take advantage of the Sun C++ Compiler, an optimizing, native compiler that closely follows the emerging ANSI C++ language definition. Make significant improvements in your program execution speed by using the variety of techniques the C++ compiler offers.

In addition to fast compilation and execution of program code, the Sun WorkShop Compiler C++ gives you the following features:

Test Changes Faster

Once a debugging session is completed, you can rebuild your application using the incremental linker. You can test the changes to your application more quickly because the incremental linker reduces the time necessary to relink an application. Only the changed .o files are linked into the previous executable to create a new executable file. Using the incremental linker, the time it takes to rebuild an application after a change is proportional to the magnitude of the change rather than to the total size of the application.

Prevent Memory Leaks

A significant addition to this release is the Sun WorkShop Memory Monitor, an automatic memory manager for C++ and C. With this feature, you can prevent memory leaks from occurring simply by relinking your program.

Sun WorkShop Memory Monitor automatically frees up leaked memory. Using this tool, you can write new programs without calling free or delete, and you can automatically fix memory errors in existing programs, even those that use third-party libraries.

You can also monitor your memory usage from within your browser and identify how much memory each part of your program is using at any time.

Sun WorkShop Memory Monitor also has a web interface that allows remote debugging. You can debug programs that exhibit memory problems in the field, but cannot be reproduced in house.

Control Optimization Levels

Take advantage of the wide range of options offered with Sun C++ compilers to manage code and application performance. Specify the -O option to optimize and improve the execution of your program. Balance performance gain, code size, and compilation time through efficient use of -O levels.

Reuse Code

C++ class libraries are modular components of reusable code. Use class libraries to integrate blocks of code that have been previously built and tested. The C++ class libraries include:

Save Time With the Tools.h++ Class Library

Save programming time with Tools.h++, the C++ foundation class library, a set of classes that are useful for essentially any programming task. Tools.h++ includes:

As a de facto industry standard, Tools.h++ has been included with a wide variety of compiler products. Consequently, Tools.h++ is available on all UNIX platforms.

Enhance Performance With the C Compiler

The C compilation system offers a compiler, assembler, and link editor. Enhance the performance of your C programs with the following C Compiler features: