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 Send TopicPrint
Hot Topic (More than 8 Replies) Updated environment won't find header files (Read 2137 times)
romeo
Newbies
*
Offline


Posts: 8
Joined: Aug 3rd, 2024
Updated environment won't find header files
Aug 3rd, 2024 at 2:01pm
Print Post  
Hi.
I am new to this forum and I am a hobbyist experimenter with Arduino and related things as one of the areas in which I dabble. Apologies in advance if I am asking inappropriate questions or questions inappropriately.

Some time back I generated an ESP 32 project
https://github.com/romeo987/TouchDRO_Interface
using an Arduino IDE and Vmicro on VS2019.  At the time I managed and modified it quite happily on my local GitHub clone.
Recently I had occasion to come back to it; I dutifully (foolish, I now realise) updated my VS2019, Vmicro and libraries and then opened my VS solution, only to be hit with red squiggly lines all over. They all SEEM to relate to failure to find the necessary header files way down the chain.
The Arduino IDE seems to put its headers and low level esp32 stuff in a chain that looks like -release_v5.1-bd2b9390ef\esp32\.....
I'm guessing that when I updated the folders recently this path changed and so my local GitHub clone chain failed. By finding the various header files down in the new chain and copying them individually to a directory immediately under my GitHub repo, I seem to be able to eliminate the squiggly lines one by one - a very painful process. I didn't take it through to completion.   
I then copied all my key project files to the Arduino projects directory and opened them from there, expecting the IDE to negotiate the appropriate search path. This was promising, except for one pair of drivers in ESP32_Quad_Encoders.h
#include "driver/gpio.h"
#include "driver/pcnt.h"
which it refuses to find even though I can clearly find them -release_v5.1-bd2b9390ef\esp32\include\driver\pcnt\include\driver\pcnt.h. 
-release_v5.1-bd2b9390ef\esp32\include\driver\gpio\include\driver\gpio.h
 
If I "promote" gpio.h and pcnt.h to a directory just below my Arduino project directory, it finds them OK but
when I look at gpio.h, it has 
#include <stdio.h>
#include <stdbool.h>
#include "sdkconfig.h"
#include "esp_err.h"
#include "esp_intr_alloc.h"
#include "soc/soc_caps.h"
#include "hal/gpio_types.h"
#include "esp_rom_gpio.h"
#include "driver/gpio_etm.h"

and about half of these now it cannot find, even though I can find them somewhere in the tree. If it could find NONE of them, that would be something....
I have spent hours googling about search paths etc, but I am not a software guy, so didn't understand some of the discussions, but the bottom line seems to be "Don't worry, the Arduino IDE will take care of all that". 
And it probably does, and I am  doing something wrong. But I'm at a loss to know what. 
Any suggestions gratefully received.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12186
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Updated environment won't find header files
Reply #1 - Aug 3rd, 2024 at 3:41pm
Print Post  
Please provide the info requested in yellow near top of page
  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12186
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Updated environment won't find header files
Reply #2 - Aug 3rd, 2024 at 5:58pm
Print Post  
We tried the project you provided and it only builds with esp32 2.0.0 toolchain. You need to install 2.0.0 using board manager in Visual Micro or the Arduino IDE
  
Back to top
IP Logged
 
romeo
Newbies
*
Offline


Posts: 8
Joined: Aug 3rd, 2024
Re: Updated environment won't find header files
Reply #3 - Aug 4th, 2024 at 4:26am
Print Post  
Thanks Tim,
I tried to install V2.0.0 using the Board Manager on Vmicro, and got the error as per attached image. Don't see how to insert it directly here).
Any suggestions?


  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
romeo
Newbies
*
Offline


Posts: 8
Joined: Aug 3rd, 2024
Re: Updated environment won't find header files
Reply #4 - Aug 4th, 2024 at 4:35am
Print Post  
Tim,
Then I tried it a second time and got a different error message
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
romeo
Newbies
*
Offline


Posts: 8
Joined: Aug 3rd, 2024
Re: Updated environment won't find header files
Reply #5 - Aug 4th, 2024 at 4:43am
Print Post  
And I can confirm that the directory
C:\Users\roman\AppData\Local\arduino15\packages\esp32\hardware\esp32\2.0.0
created just now does indeed exist, but is empty.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12186
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Updated environment won't find header files
Reply #6 - Aug 4th, 2024 at 5:16am
Print Post  
Delete this folder C:\Users\roman\AppData\Local\arduino15\packages\esp32

and this folder C:\Users\roman\AppData\Local\arduino15\staging

Then try again.

If that fails delete the folders and see if the arduino ide has same issue.

If that fails let us know what package_index.json you have set.
  
Back to top
IP Logged
 
romeo
Newbies
*
Offline


Posts: 8
Joined: Aug 3rd, 2024
Re: Updated environment won't find header files
Reply #7 - Aug 4th, 2024 at 1:15pm
Print Post  
Deleting (well...hiding) those directories worked, all squiggly lines are gone and the solution ALMOST builds although it's telling me it can't find a particular header file which I can't find any reference to in my code, and certainly not in the file and line number it's reporting.
It's late here; I'll investigate more tomorrow.
Thanks for all your help so far.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12186
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Updated environment won't find header files
Reply #8 - Aug 4th, 2024 at 1:20pm
Print Post  
Ok. 

1) If you need assistance we will need the info requested in yellow near the top of the page. It's always important for us to help.

2) The project is simple but you need to ensure you have not switched off vMicro>Compiler>deep Search. The project references libraries that reference other libraries. They will only be disovered with the default ON deep search setting.

« Last Edit: Aug 4th, 2024 at 5:58pm by Tim@Visual Micro »  
Back to top
IP Logged
 
romeo
Newbies
*
Offline


Posts: 8
Joined: Aug 3rd, 2024
Re: Updated environment won't find header files
Reply #9 - Aug 5th, 2024 at 3:41am
Print Post  
When I try to build it complains
gpio.h: 17:10: fatal error: driver/gpio_etm.h: No such file or directory
   #include "driver/gpio_etm.h"

This file is not referenced anywhere that I can see in this project, and certainly not at line 17 of gpio.h, which is

#include "soc/soc_caps.h"

I can confirm that "Deep Search" was enabled and that 2.0.0 is the only active tool chain (it does not contain a gpio_etm.h file, although 3.0.x tool chain does.

I have attached the output.
  

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: Updated environment won't find header files
Reply #10 - Aug 5th, 2024 at 12:36pm
Print Post  
Thanks for the update, can you attach a fresh log after performing the actions below?
1) Run Build > Clean Solution
2) Enable vMicro > Compiler > Verbose
3) Build the project again
  
Back to top
IP Logged
 
romeo
Newbies
*
Offline


Posts: 8
Joined: Aug 3rd, 2024
Re: Updated environment won't find header files
Reply #11 - Aug 5th, 2024 at 2:12pm
Print Post  
That was my bad. I should have realised that "Clean solution" would clean out those references. I did that as you suggested and it builds just fine.
Thanks very much for your help. 
But how do I now "package" this so that I can modify it if necessary, while at the same time having the 3.x toolchain active for newer work? Can I capture this solution and all of its associated libraries and core elements and package them in a directory somehow? I read the bit about "special files" several times top to bottom and just don't get it. Are you aware of a "Special Files for dummies" youtube video or something similar?
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2695
Joined: Feb 13th, 2019
Re: Updated environment won't find header files
Reply #12 - Aug 5th, 2024 at 3:13pm
Print Post  
To encapsulate the board package and all libraries, the Portable Folder approach would be simplest (and gives a single folder which can be compressed).

So for this you would need to create the "Arduino-Portable" folder next to your SLN file (which I believe is in C:\Users\roman\Documents\git_repos\romeo987\TouchDRO_Interface).

Now when you load your solution, you will need to install the board package again from the Micro Explorer (which will be installed into the Arduino-Portable folder).

If you ensure the sketchbook location is blank on the vMicro > General > IDE Locations screen, it will then use the Arduino-Portable\sketchbook folder.  When you install libraries they will also go beneath the Arduino-Portable\sketchbook\libraries folder.

Does that help?

We will do a video soon covering the different Special Folders' setups, as they are often most useful in certain scenarios.
  
Back to top
IP Logged
 
romeo
Newbies
*
Offline


Posts: 8
Joined: Aug 3rd, 2024
Re: Updated environment won't find header files
Reply #13 - Aug 6th, 2024 at 7:17am
Print Post  
Simon
Thanks for that. I'm not quite sure that's what I need.
  Simon@Visual Micro wrote on Aug 5th, 2024 at 3:13pm:
When you install libraries they will also go beneath the Arduino-Portable\sketchbook\libraries folder.

That suggests that this portable thing becomes my working area
Not being a software person, I could be approaching this in fundamentally the wrong way, but what I THINK I want is a frozen environment that stays permanently "attached" to this solution, with all relevant libraries and cores in a frozen configuration so I can make mods to THIS solution in THIS environment while life goes on normally in other cases. And maybe special files will enable this somehow.

Or I guess it's possible to write some sort of script to hide/expose the specific esp32 branches in my tools tree, but something more elegant would be cool.   

I shall await the video keenly...
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2695
Joined: Feb 13th, 2019
Re: Updated environment won't find header files
Reply #14 - Aug 6th, 2024 at 8:52am
Print Post  
Apologies, I haven't been clear enough....

The Portable folder is beneath a specific Solution, so only that solution will automatically use the Arduino-Portable folder and sub-folders for board packages and libraries.

Any other solution which is opened (which does not have the folder structure) will continue to use the usual board packages and sketchbook locations as configured before.

How it works

When Visual Micro detects the "solution\Arduino-Portable" the board manager, library manager and the Arduino "sketch book" folder will be assumed to exist below the "Arduino-Portable" folder. Using the Visual Micro board manager, library manager, installing libraries will be installed below the "Arduino-Portable" folder in sub folder "names" specified by the Arduino.cc specifications. Users do not need to do anything other than create the "Arduino-Portable" folder and then use the standard tools, in visual micro, to install boards and libraries.

The result is that when a solution is opened it has an entirely "ring fenced" set of boards and libraries. A solution can contain multiple Arduino projects. Therefore projects that required specific board and library versions can be 1) grouped together 2) pushed into source control with everything that is required to make an identical build at some time in the future.

Optionally, for source control, either add all "Arduino-Portable" files and folders to source control or use shared c++ projects for the core and each library (that is installed below Arduino-Portable). These shared projects should NOT be referenced in the Arduino projects as that will confuse the Arduino compatible build process. The shared projects are simply for code clarity, development assistance and source control.



« Last Edit: Aug 11th, 2024 at 6:35pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint