Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: [1] 2  Send TopicPrint
Hot Topic (More than 8 Replies) Identifiers Undefined after Update (Read 2954 times)
Maestro
Junior Member
**
Offline


Posts: 21
Location: West Virginia
Joined: Oct 12th, 2024
Identifiers Undefined after Update
Oct 12th, 2024 at 11:19pm
Print Post  
Hi, I am moving from the ESP8266 to the ESP32 so, I updated the Arduino IDE to version 2.3.3 then I updated the Visual Micro to version 2.2024.0926.1 for Visual Studio 2017. I also used the Arduino IDE to install boards and libraries for the ESP32. When I went back to Visual Studio I noticed I had boards for ESP32 but no boards for ESP8266. I figured out how to reinstall the ESP8266 boards but my main issue is described below.

Many identifiers are reported as undefined.

I have rebuilt sample projects using ESP32 and ESP8266 boards.
I have cleaned the solution.
I have reloaded the tool chain and libraries.
I have reloaded Visual Studio.

This issue just started after I did the updates.

Thanks for your help.
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12186
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Identifiers Undefined after Update
Reply #1 - Oct 13th, 2024 at 5:45am
Print Post  
Thanks for the info. Sounds like you are reporting intellisense errors? 

When you look at the name of the project that shows in the solution explorer does it have the text "(Arduino)" after it?

If yes then please confirm a line of code that shows red squiggles and error?

  
Back to top
IP Logged
 
Maestro
Junior Member
**
Offline


Posts: 21
Location: West Virginia
Joined: Oct 12th, 2024
Re: Identifiers Undefined after Update
Reply #2 - Oct 13th, 2024 at 3:04pm
Print Post  
Thanks for responding.

I loaded a program that I wanted to convert from ESP8266 to ESP32 and noticed VM went back to Arduino 1.6/1.8 and the ESP8266 board was no longer listed. Solution Explorer does not display (Arduino) next to the project name. Without changing the IDE I went to select the board but it says 0 boards found. Rescan returned 0 boards. I selected the Arduino 2 IDE and VM automatically inserted the correct board. The ino file contains Intellisense errors so I recompiled it and the errors appeared to be gone however the build failed with the following message.

error : Designtime build failed for project 'C:\Users\randy\Documents\Arduino\NodeServer\NodeServer.vcxproj' configuration 'Release|Win32'. IntelliSense might be unavailable.
     Set environment variable TRACEDESIGNTIME = true and restart Visual Studio to investigate.

I ran the TRACEDESIGNTIME=true and located the file and it reports:

Build succeeded.
    0 Warning(s)
    0 Error(s)

When I reloaded the application, it reverted back to IDE 1.6/1.8 and no board selected. I selected Arduino 2 IDE, the board reappeared with Intellisense errors and then I recompiled. The build failed this time with a function called “initSDCard” saying it was not declared in this scope. Items with red squiggles lines include:

#include (most include files)
String
IPAddress
AsyncWebServer
AsyncWebSocket
SD
LittleFS

Back to your original response this project does not have (Arduino) next to the project name, however another test project I created does. 

It has no code except for the setup and loop and 1 variable declared as String myStr =””; and it has the red squiggle line. When the project opened this morning, the IDE selected was Arduino 2 however the board was LOLIN(WEMOS) D1 R2 & mini. When I first created and compiled the project I selected an ESP32 board and the project was saved that way. 
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12186
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Identifiers Undefined after Update
Reply #3 - Oct 13th, 2024 at 4:47pm
Print Post  
1)
How do you create your projects? what do you click?

2)
With older projects from +1 year ago a vMicro menu appears that says "Convert this project to latest format". Can you see it? If so then click it. Then you will be on the latest format and will see (Arduino) after the project name.

3)
If you are not using arduino 1x anymore then open visual micro IDE Locations and clear the path you have configured for arduino 1x. Then it won't appear as a selectable ide in the editor. That might avoid some confusion

« Last Edit: Oct 13th, 2024 at 4:49pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Maestro
Junior Member
**
Offline


Posts: 21
Location: West Virginia
Joined: Oct 12th, 2024
Re: Identifiers Undefined after Update
Reply #4 - Oct 13th, 2024 at 7:28pm
Print Post  
1)      
I click vMicro>New Arduino Project

2)
I opened an older project and selected Convert this project to latest format. (Arduino) appears after the Solution name. I did a build, and it failed with the following message.

HitTest.ino: 285:51: error: 'detectsMovement' was not declared in this scope
   285 |  \*
   |                                                   ^
Error compiling sketch sources
Debug build failed for project 'HitTest'
 
None of the code was altered after the last build before the upgrades. In addition all of the #includes have squiggly lines including most of the identifiers.

I moved the ‘detectMovements’ IRAM_ATTR function above the setup procedure where the function is attached via attachInterrupt.

After rebuilding the build was successful. In the past the interrupt functions could be placed anywhere in the code but apparently not anymore.

3)
I went to the Configure IDE locations and Arduino 1.6/1.8 was selected as default and then I noticed that the location referenced the location of Arduino 2. I removed the location and rebuilt the project, and the squiggly lines were still there. I closed Visual Studio and then reopened it to the same project, and everything appears to be cured even after another build!

An IDE location for Arduino 2 is listed but the text box is disabled. I am assuming this is correct?

I will experiment with other projects tomorrow to see if the issue is fix. As for now it appears to be.

Thanks, Randy
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2695
Joined: Feb 13th, 2019
Re: Identifiers Undefined after Update
Reply #5 - Oct 14th, 2024 at 12:44pm
Print Post  
Thanks for the detail and updates.

2) The IRAM_ATTR functions should work as we inject the prototypes for the functions as part of the build process (as long as vMicro > Compiler > Deep Search for Libraries + Accurate Prototype Insertion (Gcc-E) is enabled, which it appears to be from the logs).

Can you attach the declaration for this function just in case there's something we are missing in our parsing?

3) Quote:
An IDE location for Arduino 2 is listed but the text box is disabled. I am assuming this is correct?


Yes this is correct, we only use the settings from the Arduino2 IDE which is automatically detected so we don't need the path to find it.
  
Back to top
IP Logged
 
Maestro
Junior Member
**
Offline


Posts: 21
Location: West Virginia
Joined: Oct 12th, 2024
Re: Identifiers Undefined after Update
Reply #6 - Oct 14th, 2024 at 6:05pm
Print Post  
I created a simple test project for IRAM_ATTR as shown in the code below. I tried sending images or attachments which show the squiggles but apparently, it's not allowed.

Code 1: shows the IRAM_ATTR procedure placed after the pin was attached in the preceding setup procedure. The build failed because the IRAM_ATTR was not declared. D1, IRAM_ATTR and movementDetected have squiggles in the code why? 

Code (C++)
Select All
#include <Arduino.h>

const int movementPin = D1;
int movementCount = 0;

void setup()
{
	pinMode(movementPin, INPUT_PULLUP);
	attachInterrupt(digitalPinToInterrupt(movementPin), movementDetected, CHANGE);
}

void loop()
{

}

void IRAM_ATTR movementDetected() {
	movementCount++;
}
 



Build Result:
IRAM_ATTR_Test.ino: 9:54: error: 'movementDetected' was not declared in this scope
   9 |  attachInterrupt(digitalPinToInterrupt(movementPin), movementDetected, CHANGE)
   |                                                      ^~~~~~~~~~~~~~~~
Error compiling sketch sources
Build failed for project 'IRAM_ATTR_Test'


Code 2: I moved the IRAM_ATTR function above the setup procedure and the build was successful. In Arduino version 1.6/1.8 the IRAM_ATTR procedure could be placed after the attachInterrupt in the setup procedure.  D1, IRAM_ATTR and movementDetected still have squiggles in the code?

Code (C++)
Select All
#include <Arduino.h>

const int movementPin = D1;
int movementCount = 0;

void IRAM_ATTR movementDetected() {
	movementCount++;
}

void setup()
{
	pinMode(movementPin, INPUT_PULLUP);
	attachInterrupt(digitalPinToInterrupt(movementPin), movementDetected, CHANGE);
}

void loop()
{

}
 



Build Result:
# Copy build result to 'Project>Property Pages>Intermediate Directory'
# Destination: 4/Release/"

   ║   SEGMENT  BYTES    DESCRIPTION
   ╚══ IROM     232036   code in flash


Code 3: Here I added a String and rebuilt the project, and it appears that I am still having issues with Intellisense. String does not show up in the Intellisense popup. D1, IRAM_ATTR, movementDetected and String have squiggles in the code?

Code (C++)
Select All
#include <Arduino.h>

const int movementPin = D1;
int movementCount = 0;
String myStr = "";

void IRAM_ATTR movementDetected() {
	movementCount++;
}

void setup()
{
	pinMode(movementPin, INPUT_PULLUP);
	attachInterrupt(digitalPinToInterrupt(movementPin), movementDetected, CHANGE);
}

void loop()
{

}
 



Build Result:
# Copy build result to 'Project>Property Pages>Intermediate Directory'
# Destination: 4/Release/"

   Code in flash (default, ICACHE_FLASH_ATTR), used 232644 \ 1048576 bytes (22%)
   ║   SEGMENT  BYTES    DESCRIPTION
   ╚══ IROM     232644   code in flash

Any help would be appreciated because this is quite annoying dealing with Intellisense while writing code.

Thanks, Randy


  
Back to top
 
IP Logged
 
Maestro
Junior Member
**
Offline


Posts: 21
Location: West Virginia
Joined: Oct 12th, 2024
Re: Identifiers Undefined after Update
Reply #7 - Oct 14th, 2024 at 9:00pm
Print Post  
I loaded one of the programs that I need to work on today that was developed using VM with the Arduino 1.6/1.8 IDE. After loading I selected VMicro>Convert this project to latest format. Output says it was successful and (Arduino) was added next to the project name. I built the project, and the Output reports the following:

error : Designtime build failed for project 'C:\Users\randy\Documents\Arduino\NodeServer\NodeServer.vcxproj' configuration 'Debug|ARM'. IntelliSense might be unavailable.
     Set environment variable TRACEDESIGNTIME = true and restart Visual Studio to investigate.
error : Designtime build failed for project 'C:\Users\randy\Documents\Arduino\NodeServer\NodeServer.vcxproj' configuration 'Debug|ARM'. IntelliSense might be unavailable.
     Set environment variable TRACEDESIGNTIME = true and restart Visual Studio to investigate.
error : Designtime build failed for project 'C:\Users\randy\Documents\Arduino\NodeServer\NodeServer.vcxproj' configuration 'Debug|ARM'. IntelliSense might be unavailable.
     Set environment variable TRACEDESIGNTIME = true and restart Visual Studio to investigate.
error : Designtime build failed for project 'C:\Users\randy\Documents\Arduino\NodeServer\NodeServer.vcxproj' configuration 'Debug|ARM'. IntelliSense might be unavailable.
     Set environment variable TRACEDESIGNTIME = true and restart Visual Studio to investigate.
One particular enum has squiggles under it but not in all places that the enum is used in the code.

I did the TRACEDESIGNTIME yesterday as posted in a previous post above.

Any ideas how to fix this?
  
Back to top
 
IP Logged
 
Maestro
Junior Member
**
Offline


Posts: 21
Location: West Virginia
Joined: Oct 12th, 2024
Re: Identifiers Undefined after Update
Reply #8 - Oct 14th, 2024 at 9:09pm
Print Post  
One more thing I noticed about this issue is that all of the combo boxes above the code window are empty.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12186
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Identifiers Undefined after Update
Reply #9 - Oct 14th, 2024 at 9:23pm
Print Post  
please close the solution and then zip and email the project folder. if it contains a sub folder called ".vs" delete it first.

Thanks
  
Back to top
IP Logged
 
Maestro
Junior Member
**
Offline


Posts: 21
Location: West Virginia
Joined: Oct 12th, 2024
Re: Identifiers Undefined after Update
Reply #10 - Oct 14th, 2024 at 10:10pm
Print Post  
I emailed it to you.

If this helps:

In the project that I need to work on where the combo boxes were emptied after a build failed, I did a Rescan Toolchains and Libraries, and the combo boxes repopulated.
  
Back to top
 
IP Logged
 
Maestro
Junior Member
**
Offline


Posts: 21
Location: West Virginia
Joined: Oct 12th, 2024
Re: Identifiers Undefined after Update
Reply #11 - Oct 15th, 2024 at 2:43am
Print Post  
In response to Reply #7

I ran the TRACEDESIGNTIME and discovered the following error:

SD-2.0.0.vcxitems" was not found.

Version 2.7.4 does not exist at that path so I looked in the projects vcxproj file and discovered a reference to the SD library that was the older version.

I deleted everything created by VM and started fresh with just the ino file and data directory. I used VM to open an existing project and the build was successful.

However, everything that uses declarations from the header files has squiggles under them including the declaration for String. After the build the squiggles disappear for a quick second and then reappear.

I hope this helps you in some way to help me figure out what's going on.

Thanks, Randy
  
Back to top
 
IP Logged
 
Maestro
Junior Member
**
Offline


Posts: 21
Location: West Virginia
Joined: Oct 12th, 2024
Re: Identifiers Undefined after Update
Reply #12 - Oct 15th, 2024 at 3:08am
Print Post  
Here are some snapshots of the code with squiggles. It's odd because you'll see WiFi on one line with squiggles and the following WiFi line without squiggles. Look at the next image with the break statement. Squiggles like this are common in various places in the code.


  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2695
Joined: Feb 13th, 2019
Re: Identifiers Undefined after Update
Reply #13 - Oct 15th, 2024 at 8:59am
Print Post  
Thanks for the updates and detail.

Is the project with the errors here the one with "(Arduino)" after its' name in Solution Explorer?
(I only ask as you mentioned one project did have it and another did not)

The vcxitems file being missing implies that the libraries were added to the project with one of the Shared/Cloned project options enabled.  These are useful for static projects, but updating those libraries can cause issues if not done correctly.

Generally its' best to ensure all of the options are OFF under vMicro > Add Libraries > Advanced, and any shared/cloned library projects are created outside of the normal board package and arduino\libraries folders to reduce the risk of them being accidentally corrupted via update.

There is now an alternative approach to encapsulating libraries with a project if it is needed, which can be seen on the below page, under the Complementary Special Folders section, which does not need the vcxitems, and updating is as simple as replacing a folder of files:
https://www.visualmicro.com/page/Special-Folders-and-Portability.aspx
  
Back to top
IP Logged
 
Maestro
Junior Member
**
Offline


Posts: 21
Location: West Virginia
Joined: Oct 12th, 2024
Re: Identifiers Undefined after Update
Reply #14 - Oct 15th, 2024 at 5:00pm
Print Post  
Yes, the project I sent has (Arduino) next to the project name.

The issue with the vcxitems was taken care of when I deleted all of the VM files and reopened the project ino through vMicro>Open existing Arduino project.

The real issue here is with IntelliSense as demonstrated in the images from post 12. Any existing project that I open or create new will exhibit the same issue with IntelliSense.

I do not have any issues using the Arduino IDE.

Today I discovered the following:
I removed the Arduino 1.6/1.8 IDE location using VMicro>Configure IDE locations as per instructions in post #3.

Today I was looking through VMicro>Global Options and then selected Application IDE location and found that the Arduino 1.6/1.8 location was still listed and showed up as default. 

I went back to VMicro>Configure IDE locations and the Arduino 1.6/1.8 location was not listed there. 

I then went back to VMicro>Global Options then selected Application IDE location and tried to remove it from there. However, it remained. 

I went back to VMicro>Configure IDE locations and Arduino 1.6/1.8 was re-added after attempting to remove it from the global options.

Is this normal?

Perhaps my only solution is to uninstall vMicro and reinstall it. What do you think?

I can't keep wasting time on this issue I have to get back to work.


  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2695
Joined: Feb 13th, 2019
Re: Identifiers Undefined after Update
Reply #15 - Oct 15th, 2024 at 5:13pm
Print Post  
Thanks for the update and detail.

We cannot reproduce the Intellisense issue currently, can you try closing Visual Studio, and deleting the ".vs" folder from the Project folder, then re-opening it again.

If you have any other Intellisense extensions installed (e.g. Re-Sharper) these can cause conflicts with Visual Micro.


The IDE Locations screen always shows the Arduino 1.6/1.8 option by default, so selecting the IDE you want to configure is required.   
The one actually in use is shown at the top of the vMicro Menu, and if multiple IDE's are configured you can quickly change between them from there.
If you want it to stop showing up in the IDE selection at the top of the vMicro menu, clear the IDE Location Field for the Arduino 1.6/1.8 Configuration on the IDE Locations screen, and click OK to apply it.

We have a fix for the prototype/compilation issue reported with the IRAM_ATTR function being placed after it is used which will be released in the next day.
  
Back to top
IP Logged
 
Maestro
Junior Member
**
Offline


Posts: 21
Location: West Virginia
Joined: Oct 12th, 2024
Re: Identifiers Undefined after Update
Reply #16 - Oct 16th, 2024 at 7:58pm
Print Post  
I opted for removing vMicro and did a repair to Visual Studio 2017. I also removed Arduino 1.6/1.8. I rebuilt my ino code using the Arduino 2 IDE. All the board and all the libraries are there and everything is working as it's supposed to.

Now I want to install the latest version of vMicro for Visual Studio 2017. Before I do I have a question. 

In this link it says to be sure the:

"Embedded and IoT Development component is also selected" 

and

"VS2017 versions must now be directly installed from the Forum, or can be downloaded from here."

The downloaded from here link goes to a oops page where someone should receive 2000 lashes. (lol)

https://www.visualmicro.com/page/Arduino-Visual-Studio-Downloads.aspx

Down below there is a link for a mixed 2017/2019 download.

Another install page for VS 2017 makes no mention of installing the Embedded and IoT Development component.

https://www.visualmicro.com/page/User-Guide.aspx?doc=Getting-started.html

Question:
Is the Embedded and IoT Development component needed and is there a particular download specifically for VS 2017? Silly questions but I am trying to cover all my bases before I install again.

Thanks, Randy
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12186
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Identifiers Undefined after Update
Reply #17 - Oct 16th, 2024 at 8:47pm
Print Post  
The download link is working when tested. Maybe a shor term server glitch. To ensure the correct link click the one you added above. Does that work now?

The order of install is not important and anyway, the tools should automatically install with visual micro.
  
Back to top
IP Logged
 
Maestro
Junior Member
**
Offline


Posts: 21
Location: West Virginia
Joined: Oct 12th, 2024
Re: Identifiers Undefined after Update
Reply #18 - Oct 16th, 2024 at 9:27pm
Print Post  
All fixed thank you for your help!
Smiley

Randy
  
Back to top
 
IP Logged
 
Maestro
Junior Member
**
Offline


Posts: 21
Location: West Virginia
Joined: Oct 12th, 2024
Re: Identifiers Undefined after Update
Reply #19 - Oct 16th, 2024 at 10:50pm
Print Post  
Looks like I spoke too soon because my test was a simple sketch like the one mentioned on your site in Setup after install.

When I opened my sketch the problem with IntelliSense was still there.

I searched the forum for PCH warnings and found a few but did not see a solution other than it could be related to one more of the include files. I am going to start a new conversation on that thread.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send TopicPrint