Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29234 Discussions

"Identifier is undefined" in "Watch" during debugging

jirina
New Contributor I
8,515 Views

I am getting the message "identifier "variable_name" is undefined" in the column "Value" of the "Watch" window during debugging. This message is shown both for subroutine/function arguments, no matter is they are scalar variables or arrays, and for local scalars.

This seems to be a random behavior: while I was able to see expected values in the morning, I am getting the message in the afternoon. Nothing changed on my computer; there were no updates to Windows, Visual Studio 2022 or Intel oneAPI 2025.2.0. Also, there were no changes of the solution/project, neither in its settings, nor in the source code, nor in the compiler (I am using IFX).

Restarting the computer, restarting Visual Studio, rebuilding the solution did not help.

Is there anything I can try to make "Watch" display values of scalars and arrays?

I should add that I have already experienced this behaviour in previous versions of oneAPI, but only for arrays, and what helped in some cases was to restart the debugger. This does not help now.

0 Kudos
22 Replies
garraleta_fortran
8,212 Views

Yes

0 Kudos
Mark_Lewy
Valued Contributor I
7,846 Views

It looks like the Fortran expression evaluator has stopped working.  By coincidence (?), this happened to me and a colleague today. We're both using VS 2022.  I have OneAPI 2025.2 and the validated VS 2022 17.12.4 LTSC installed.  A repair of OneAPI base then HPC toolkits seems to have fixed the problem.

0 Kudos
netphilou31
New Contributor III
7,829 Views

Hi,

Several of my colleagues get the same, weird, behavior. A repair of the Basic and HPC toolkits solved the issue. 

Today I experienced the same problem. After repairing the packages the problem vanished but came back very quickly after. I tried again to repair the intallations but, this time, with no success even after a clean reboot (I am using VS 2022 17.14.3 and oneAPI 2023.2.0). Since I have also oneAPI 2024.2 installed I tried reparing the corresponding Basic and HPC kits and this seems to solve the issue, but for how much time ?
When using several versions of the kits, is it always necessary to repair the most recent one ?

Best regards,

0 Kudos
Mark_Lewy
Valued Contributor I
7,684 Views

You should only repair the latest version of OneAPI, as the IDE integration is normally for the latest version.  You also may find that you only need to repair the Base toolkit, which, given the long wait for integration during each installation is worth checking before you try repairing the HPC toolkit.

0 Kudos
netphilou31
New Contributor III
7,601 Views

Hi,

Thanks for the advice. My colleagues have only on version installed, and since I mainly use only one (not the latest), I didn't think about reparing the latest one instead. I will try to remember for the next time.

Best regards,

0 Kudos
JohnNichols
Valued Contributor III
7,384 Views

I am using the latest preview and the watch works.  VS updates a lot, it is difficult to stay with the validated ones. 

Very rarely do you have problems if you update with MS VS to the latest.  

0 Kudos
David_Billinghurst
New Contributor III
6,964 Views

Yes.  We have been affected by this too.  It started about a week ago and affected four users overnight.  We are not aware of any  upgrades.  A repair seems to work for a while.  Unfortunately this takes ages.  It feels like the repair team has to fly across the Pacific from the US for each callout.  The problem returns intermittently.

Most of us are using Visual Studio 2022 LTSC 17.10 with oneAPI 2024.2 ifort, although I also have oneAPI 2025.2 installed.  (I am the ifx guinea pig).

Interestingly, the watch window often works if the variable names are retyped in UPPER CASE.  Perhaps the debugger is using C/C++ support and not Fortran.  Is there a way to test this?

 

0 Kudos
Mark_Lewy
Valued Contributor I
6,881 Views

Yes, in the absence of Fortran support, VS is treating the code as C/C++ and because Fortran symbols are upper case and C/C++ is case sensitive you have to use upper case to watch variables. 

0 Kudos
garraleta_fortran
6,849 Views

Uninstalling intel-oneapi-hpc-toolkit-2025.2.0.576_offline
is practically impossible. Hours, hours, hours...

0 Kudos
MaBe
Beginner
6,747 Views

I experienced exactly the same issue from one day to the other. No change at all in my configuration. It worked properly in the evening and stopped in the morning.

0 Kudos
MaBe
Beginner
6,745 Views

....but the issue does not occur for uppercase variables

0 Kudos
garraleta_fortran
6,542 Views

It's a problem for Sherlock Holmes.
I run it last thing at night and it works.
The next morning it doesn't work.
Absolutely nothing modified or installed.

0 Kudos
garraleta_fortran
4,576 Views

WITH THE NEW VERSION

intel-fortran-compiler-2025.2.1.11_offline

THE PROBLEM IS SOLVED

0 Kudos
BalFort
Beginner
4,557 Views

It seems that I can only download the 2025.2.1.6_offline version, can you already see the new one?

 

EDIT: I downloaded the latest release of the compiler only, but the problem is still present

0 Kudos
Markus_is_Mark
Beginner
6,408 Views

I spent the morning trying to trace this down. I didn't fix anything but did notice something interesting. The LOCALS are all correct and uppercase only. When I use a WATCH window I have to also use uppercase otherwise I get the same message you do. I have looked at compiler options and it appears that upper and lower case should be supported, but this is probably a debugger issue(?). I hope someone comes up with a fix soon. Hovering over a variable doesn't work, although I haven't tried it with upper case variables yet.

0 Kudos
JohnNichols
Valued Contributor III
6,367 Views

In a separate thread, I explained the error to the Intel GURUS.  Before the current thread lit up again. 

The watch has been miscoded so it only works on uppercase variables, so MUL not mul will work. Fortran recognizes them as the same, so no problem, but it you want to look at the value, you have to change the name to all upper case at the location you want to know, it can remain the same anywhere else.  Nothing else will work.

Hopefully, Intel will correct the error and it is a simple one, but it is not worth further discussion as we cannot fix it and we know the workaround.  

 

0 Kudos
Adrian41
Beginner
5,639 Views

I experienced the same problems with the packages Base & HPC toolkits - in the last stage of installation, i.e. the integration with Microsoft Visual Studio. (I use MVS Professional 2022 Version 17.14.12).
For now, the solution was to install Intel® Fortran Essentials Toolkit. Everything went fine, and the Debugger works as expected.

 

0 Kudos
BalFort
Beginner
4,609 Views

I've also experienced this problem. I see that there is also a problem in watching variables that are placed in a module and loaded in some part of the code. To have them visible in the WATCH it seems that it is necessary that such variable is used in a IF block like (assuming A is a REAL variable that is in loaded from a module):

IF (A .GT. 0.d0) THEN
    CONTINUE
ENDIF

 or printed with print like:

PRINT*, A  

 This will also show variable A in the "Local variables" tab.

Moreover, I noticed that the variables with "ALLOCATABLE" attribute are not loaded in any case by the WATCH.

I just wanted to share you these findings, maybe they can help someone while we wait for the fix from Intel.

I'm currently using the latest version of Intel® Fortran Essentials Toolkit (2025.2.1.6) and Visual Studio Enterprise (17.14.12)

0 Kudos
Adrian41
Beginner
4,455 Views

By the time I downloaded Fortran Essentials, it was an earlier version 2025.2.0.510.
There is no any problem in viewing a variable value, either in the Watch window, or in code while selecting or swapping over a variable. There is no differences for allocatable variables.
The sole possible explanation for the behavior you noticed would be a bug in the integration of Intel package with the IDE (Visual Studio.).

0 Kudos
BalFort
Beginner
4,392 Views

I've tried rolling back to the July update of VS (version 17.14.9) and with the latest version of intel-fortran-essential (2025.2.1.6) and now the watch works as expected, without the need of using upcase keywords or strange workarounds. Indeed it could be a problem of VS and not Intel.

0 Kudos
Reply