Share via

Visual Studio Code: cannot compile FORTRAN-Code

Juergen Babenhauserheide 0 Reputation points
2023-11-18T11:54:54.96+00:00

Hello,

I added the “Modern Fortran” extension to Visual Studio Code (version: 1.84.2, OS= WINDOWS 11 64 Bit) and added the corresponding path to “fortls”.

I added the following file CMakeLists.txt to the FORTRAN code (helloworld.f90), as I do with a C++ file.

CMakeLists.txt:

Compiler settings - Can be customized.

CC = gfortran

CPP = gfortran -cpp

CXXFLAGS = -g -Wall

LDFLAGS =

Makefile settings - Can be customized.

APPNAME = helloworld

EXT = .f90

SRCDIR = src

OBJDIR = obj

If I now want to compile the FORTRAN code under “Run and debug”, I get the display: “Select debugger”.

Suggested: "Cmake Debugger", so I get the message: "CMake does not support automatic debugging for this file.

I can compile the FORTRAN code on the console with: ”gfortran file.f90”.

Kind regards

Juergen

Developer technologies | Visual Studio | Other
Developer technologies | Visual Studio | Other

A family of Microsoft suites of integrated development tools for building applications for Windows, the web, mobile devices and many other platforms. Miscellaneous topics that do not fit into specific categories.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Anna Xiu-MSFT 31,201 Reputation points Microsoft External Staff
    2023-11-20T09:48:32.1766667+00:00

    Hi @Juergen Babenhauserheide

    Welcome to Microsoft Q&A! 

    You are using Visual Studio Code, which is different from Visual Studio product. The tag “Visual Studio” is related to Visual Studio, for more questions about Visual Studio Code, we suggest you post it to the GitHub repository where you would get professional support for this product.

    Thanks for your understanding. 

    Sincerely,

    Anna


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

     

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.