Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29533 Discussões

Issues with watching variables in VS2022

Jon_D
Novo colaborador II
1.610 Visualizações

Hello,

I recently installed VS2022 Community Edition and the latest Fortran compiler (2025.3.1). When I try to watch a variable in a debug session, I get an "identifier is undefined" error. I can only see the value if I write out the variable in all caps (see screenshot WatchWindow.jpg). This was reported in an other thread in this forum and it was deemed to be an issue of VS2022.

However, I have another computer with the same VS and Fortran installed, and everything on that computer works well. Comparing the installation details via Visual Studio Installer, I see that the computer on which the debugger works as expected has Intel oneAPI Debugger Integration and Intel Distribution for GDB installed (see screenshot WorkingDebug.jpg). The computer that the debugger is not working does not have these components installed (see screenshot ProblemDebug.jpg).

I normally install the standalone Fortran compiler. Assuming that this maybe the cause of the issue, I installed the Intel Fortran Essentials, which is supposed to include Intel Distribution for GDB, but nothing changed. Interestingly, custom installation option shows all components that is supposed to be part of the Fortran Essentials except Intel Distribution for GDB. Webpage to download Intel Distribution for GDB as a standalone tool for Windows says the product is not available.

Has anybody run into this same issue? Any guidance on this would greatly be appreciated.

Thanks.

0 Kudos
1 Solução
Steve_Lionel
Colaborador honorário III
1.575 Visualizações

That the variable type shows as "int" tells me that the Fortran debug support is not being activated. Try this. 

Open Visual Studio and go to the main window. From the top toolbar, select Extensions > Manage Extensions.  Search for "Fortran" - you should see two items listed,  Intel Fortran Compiler and Intel Fortran Expression Evaluator. It's OK if the first shows as not installed, it's the second you are interested in. If the button says "Install", click it. Then close and reopen Visual Studio. If it says it is installed, use the ... button to uninstall it, then reinstall it and reopen VS.

Ver solução na publicação original

5 Respostas
Steve_Lionel
Colaborador honorário III
1.576 Visualizações

That the variable type shows as "int" tells me that the Fortran debug support is not being activated. Try this. 

Open Visual Studio and go to the main window. From the top toolbar, select Extensions > Manage Extensions.  Search for "Fortran" - you should see two items listed,  Intel Fortran Compiler and Intel Fortran Expression Evaluator. It's OK if the first shows as not installed, it's the second you are interested in. If the button says "Install", click it. Then close and reopen Visual Studio. If it says it is installed, use the ... button to uninstall it, then reinstall it and reopen VS.

JohnNichols
Colaborador honorário I
1.146 Visualizações

Screenshot 2026-02-05 181256.png

With the debug parameters set in iFX, the n does no appear in the watch window as it does in IFORT.  

JohnNichols_0-1770336877783.png

 

    program gaver_stehfest
    use, intrinsic :: iso_fortran_env, only: wp => real64
    
    implicit none
    integer, parameter :: n = 69, tpts = 100
    integer, parameter :: gsn = 16 ! Stehfest Parameter gsn (6 < gsn < 20; only even number)
    integer :: i
    real(wp), parameter :: ln2 = log(2._wp)

    ! Variables

    ! Body of gaver_stehfest
    print *, 'Hello World'

    end program gaver_stehfest

This is a brief working segment out of the program I was looking at. I left in a few parameters, the array parameter showed up so I left it out.  

 

But this shows up

    real(wp), parameter :: factorial(*) = [(gamma(real(i + 1, kind=wp)), i = 1, n)]

 - how long has one been able to use a function to define a parameter array? 

Jon_D
Novo colaborador II
1.570 Visualizações

Yes, that worked. Thank you Steve!

Steve_Lionel
Colaborador honorário III
1.142 Visualizações

John, I'm guessing that you don't have FEE installed. Using an intrinsic function in an initialization expression has been in the language for many years.

JohnNichols
Colaborador honorário I
1.131 Visualizações

Screenshot 2026-02-05 191440.png

 

Screenshot 2026-02-05 191404.png

Unless there is another one then they are installed, and it works on IFORT.   but not IFX.  

Responder