Lahey Fortran

Building And Running Your First Lahey Fortran Project

Now that Lahey Fortran and the Visual Studio development environment are installed, you are ready to create your first project. This section contains step-by-step instructions for creating a project, and then building and running the DEMO.F90 example provided in the installation.

  1. Open Visual Studio.
  2. Select File > New > Project. This brings up the New Project dialog box.
  3. Create an Empty Project template by selecting Lahey Fortran in the left pane and Empty Project in the center pane.

  4. Change the Name to "MyDemo". Change the Location, if desired. Click OK.
  5. An empty MyDemo project is created and is reflected in the Solution Explorer window. (If Solution Explorer is not visible, you can make it visible by selecting View > Solution Explorer.)

  6. Select Project > Add Existing Item. This brings up the Add Existing Item dialog box.
  7. Navigate to the Examples\LF95 subdirectory under the installation directory (by default <Program-Files>\Lahey-Fujitsu Fortran\<ver>\Examples\LF95) and select the Demo.f90 file. Click Add.
  8. Demo.f90 will be copied to the project folder and the Solution Explorer window will now show the Demo.f90 item under the MyDemo project.
  9. Build and run the project by selecting Debug > Start Without Debugging.
  10. The application will build and then run in an external console window.

Congratulations! You have just created and run your first Visual Studio Fortran application!

To view or edit the Demo.f90 source code, double-click on the Demo.f90 item in the Solution Explorer.

Note: After initial installation, Lahey/Fujitsu Fortran 95 (LF95) will be the default build compiler. For information on changing the current compiler, as well as how set build options, see Setting Build Options.