Changing compiler options from Visual Studio

General information on how to use Visual Studio with FTN95 and how to create a simple Fortran project is given in Getting Started with FTN95.

By default a new FTN95 project in Visual Studio will be configured for .NET rather than Win32 and will be set in debug rather than Checkmate or release mode. On the FTN95 command line, the .NET platform is selected by using the compiler option /CLR whilst Checkmate mode is selected by using /CHECKMATE.

In general, compiler options can be set at three levels: solution level, project level and file level.

Solution level

The default settings can be changed from the Solutions Configurations drop-down list on the main toolbar or from the Configuration Manager dialog. Select Configuration Manager from the main Build menu in order to open this dialog.

Choose a mode using the box at the top entitled Active Solution Configuration. Click on the arrow icon and select a mode from the drop down list. Release mode can be selected when a solution is ready for use/shipping. The debug and Checkmate configurations plant debugging code that allows you to step into the code using the integrated debugger. The default configuration is Checkmate and this is recommended for development.

The names that appear in this list (Debug .NET etc) are names for standard configurations. By selecting <New...> from the list you can create a new configuration. Choose an existing configuration as a basis and then change the default settings at project level using the Project Contexts grid.

The Projects Context grid describes the configuration for each project and by default this reflects the Active Solution Configuration. It is better to leave this grid unchanged unless you are defining a new Active Solution Configuration.

Note that you can also change the default .NET platform to Win32. Most of the features of Visual Studio can be used to create Win32 as well as .NET applications and DLLs (you can even use ClearWin+ together with the Visual Studio image and dialog editors if you wish).

Project level

Having selected a configuration at solution level, additional compiler options can be included for each project in the solution. To do this open the Property Pages dialog for the project by clicking on the name of the project in the Solution Explorer window. Click on the right mouse button and select Properties from the popup menu.

The following dialog appears...

Configuration: By default this will be set to the active solution configuration and need not be changed.

Platform: By default this will be set to the active solution platform and need not be changed.

Configuration properties: Compiler options are classified in the tree on the left hand side of the dialog. Most of the options can be left in their default state. Under Miscellaneous you will find Output File Type. Change to DLL or LIB if you are creating a DLL or library file. In the same section you will also find Launch Arguments. If the project creates an executable rather than a DLL or library then (for the purpose of debugging) any arguments required by the executable should be included here. For example, if your application processes a file and the name of the file is provided on the command line after the name of the executable, then the name of a sample file can be included here. When using Visual Studio 2005 .NET Framework Version allows you to chose the version of the .NET Framework to target, versions 2.0 or 1.1 are available.

All options have help information that appears in the field at the bottom of the dialog, select an option to see the help for it.

File level

When your project contains a number of files, you can set different compiler command line options for a particular file by using the File Properties window as follows.

Click with the left mouse button on the name of the file in the Solution Explorer window (or use the right mouse button and select Properties from the popup menu). Now look at the Properties dialog that normally appears below the Solution Explorer dialog. If the Properties Window is not visible, select Properties Window from the main View menu.

On the CustomCompilerOptions line, click on Off and the resulting arrow icon in order to view the options to Append to or Override the project options. Now type in the options in the box labeled CustomSwitches. For example, if the project is set to debug rather than Checkmate mode then a particular file might be set to Checkmate mode with the following entry.

You can also use this dialog to:

1) Exclude this file from the build process.

2) Change the name of the file (this renames the file on the drive and in the solution).

3) View certain properties of the file.

4) Mark the file as read only.



Copyright © 1999-2024 Silverfrost Limited