Part 2. Modifying Configuration Options
In Part 1, you used the SmartGuides to create a simple project. You now have a
configuration file for your project and one source file, main.cpp. In this part you will
learn how to set or modify options for your project.
Because the SmartGuides did such a good job of helping you create your project, all the
necessary options were set for you. The option you will change in this part will not have
a great impact on this project. However, changing it will illustrate how easily you can
change options for your project, target, or source files from within the VisualAge C++
IDE.
This section should take you approximately 15 minutes to complete. In it, you will
learn to perform the following IDE tasks:
- View the options for your project's target and navigate the options hierarchy
- Use the Live Find feature to locate text
- Determine whether an option is the default or has been overridden
- Change the setting of an option
- View the source for your configuration file
Change Your Target CPU Architecture Option
By default, the target CPU architecture is an Intel 80486 processor. In all likelihood
you are running a newer processor, such as a Pentium or Pentium II processor. By changing
the target CPU option, you allow VisualAge C++ to generate an executable file containing
instructions that are only supported by the newer processor. In a real application, making
this change might improve performance, although in this tutorial you will not notice any
difference.
You can add, modify, or delete configuration options for your project in the
Configuration section of the workbook. Follow these steps to specify your processor:
- Select the Configuration section of the workbook.
- Select the Options page of the Configuration section.
- The left-hand pane shows a Source and Targets view of the
configuration, while the right-hand pane shows a Change Options view. Any
options you change in the Change Options view are applied to the object
selected in the Source and Targets view. Select the Target
object in the Source
and Targets view.
- Press F6 to move to the Change Options view.
- There are two ways you can locate the option you want to change.
- You could expand various entries in this view until you find the Target CPU
architecture for instruction set selection option.
- You can open a Live Find field by pressing Ctrl+F. In the Change
Options view, the Live Find field is already displayed for you at the bottom of
the pane, with the Live Find icon
to its left. Click
the Live Find field, and slowly type Penti. Notice that as soon as you have
typed P, the view changes to display the Target CPU architecture...
option, and as soon as you have typed Pe, the first Pentium choice is
displayed. You may also see that the light turns yellow on the flashlight icon as soon as
your entry has a match.
For more information on using this feature, see Search
a View Using Live Find in the online help.
- Notice that the current choice, Target Intel 486 processor, is selected
with a grayed radio button. This indicates that the grayed choice is the default and that
the default is being used; no information for this option appears in your configuration.
If you click this choice, the radio button changes to black, to indicate that this option
is now explicitly set to the default 486 choice.
- Select the processor you are using. The text of the option you chose turns green. An
option's text is displayed in green when its value, for the currently selected source or
target, is set by your configuration. In other words, you have explicitly chosen a setting
for this option, whether or not that setting is the default.
- Click Apply at the bottom of the view. This saves any option changes
you have made. The next time you build your project, these changes will take effect.
- Select the Source view of your configuration file in the Configuration
section (the rightmost button along the top of the Configuration section). You will see
that gen(arch,"pentium") or gen(arch,"pentium2") is now one of the
target options for your project.
You can now proceed to the next part of the tutorial: