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.
- Open Visual Studio.
- Select File > New > Project. This brings up the
New Project dialog box.
- Create an Empty Project template by selecting Lahey Fortran in the left pane and Empty Project in the center pane.
- Change the Name to "MyDemo". Change the Location, if desired. Click OK.
- 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.)
- Select Project > Add
Existing Item. This brings up the
Add Existing Item dialog box.
- 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.
- 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.
- Build and run the project by selecting Debug > Start Without Debugging.
- 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.