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
Normal Topic Deep search cannot find existing files (Read 4201 times)
Mike_D
Newbies
*
Offline


Posts: 4
Joined: Nov 29th, 2018
Deep search cannot find existing files
Nov 29th, 2018 at 10:32pm
Print Post  
Hi, this is my first post here, and the forum seems to have a lot of these questions posted before concerning deep searching for libraries. I mean, google is full of them.

The reason I have posted is because it is strange to have a file not found when not only does it appear in the dependencies section of my project, but I can also open and read the contents of such files.

Having the compiler tell me it has found a deep search error is therefore frustrating since not only does the IDE know about the file, it can open it too.

I have not yet solved this issue, so is there now, or in the future, going to be a solution to this?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Deep search cannot find existing files
Reply #1 - Nov 29th, 2018 at 10:53pm
Print Post  
Possible answer: Deep search looks in the libraries your code uses to find #includes to other libraries. When you use a library you also need to ensure that any libraries it uses are installed.

generally if you have an error it is best to post the full info. In this case the missing file name will help but also what board and libraries you believe your code uses.
  
Back to top
WWW  
IP Logged
 
Mike_D
Newbies
*
Offline


Posts: 4
Joined: Nov 29th, 2018
Re: Deep search cannot find existing files
Reply #2 - Nov 29th, 2018 at 11:06pm
Print Post  
I can do that certainly.

Code
Select All
Compiling debug version of 'ESPTest' for 'ESP32 Dev Module'

ESPTest.ino: 30:31: fatal error: Update\src\Update.h: No such file or directory
   compilation terminated



	An error was encountered during the 'Deep Search' library discovery process.
Debug build failed for project 'ESPTest'
 



The library is for the ESP32, which is installed because I have full access to the WifiClient classes and the ESPClass for system information.

The IDE will actually highlight a file it cannot include, so mistakes are hard to make, IMHO. It seems the deep search system itself is flawed, mainly because the dependency is listed, readable, and most likely modifiable from with solution explorer and the IDE.

Are you saying deep search does not use the same path syntax when including files? This might explain things.

It's worth mentioning that I tried to include another header file (Preferences.h) and had the same error, so I decided to come back to that. Fully qualifying the path, by physically locating it on my hard drive, does not work either.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Deep search cannot find existing files
Reply #3 - Nov 30th, 2018 at 11:17am
Print Post  
To include an Arduino library in code you should use this syntax:-

#include <LibName.h>

You should not specify a folder path or the \src folder.
  
Back to top
WWW  
IP Logged
 
Mike_D
Newbies
*
Offline


Posts: 4
Joined: Nov 29th, 2018
Re: Deep search cannot find existing files
Reply #4 - Dec 1st, 2018 at 12:10am
Print Post  
Well, I can report the advice given was correct. After a build the files were indeed found by the compiler and the IDE no longer marks the files as not found after a build.

It's worth mentioning that you can enclose include files in quotes, that actually makes no difference.

Not sure why the IDE would not find the files until a build, is there any way to stop this behavior? It might be old school on my part but this would be the first time I have built a project with visible errors in the IDE. The temptation is to trust the IDE, and when it says it cannot find a file, believe the IDE.

Anyway, thank you for your help. Using Visual Studio as my main programming environment is a big plus for me, as I already use it for non AVR projects, great job.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Deep search cannot find existing files
Reply #5 - Dec 1st, 2018 at 1:17am
Print Post  
Thanks for the update and message.

Actually it's more complicated that it seems for arduino to work in a real ide. Arduino compatibility means no project, no include paths, automatically discovered libraries. Moving a library to a different location would be automatically discovered where as in a normal ide you would have to change reference or include paths. Switching board can also mean the intellisense include paths need to be changed.

Visual Studio does not understand arduino projects so the intellisense which vs provides is unrelated to the actual Arduino build process that visual micro performs. We never declare where libraries are located and they are not #included with paths, therefore we have to reply on running external tools to detect new libraries and perform compilations.

In early (year or two ago) arduino ide's the only way to include libraries was by adding them as #includes to the .ino files. These were then found using a regex which was easy for intellisense but not very scientific. 

Then "deep search" was released which can find libraries within #if conditions and also find libraries #included deep inside other libraries and project .cpp code. This involves scanning all cpp sources and running an external program called GCC.exe with -E parameter to find all the #includes. It's too slow to incorporate this resolution into intellisense, therefore when you add libraries run a build, which caches the discovered includes and combines them into  intellseinse along with selected board core.


  
Back to top
WWW  
IP Logged
 
Mike_D
Newbies
*
Offline


Posts: 4
Joined: Nov 29th, 2018
Re: Deep search cannot find existing files
Reply #6 - Dec 1st, 2018 at 1:34am
Print Post  
Thanks for explaining the process. I am sure others will find it helpful.

Running a dummy build is a small price to pay.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint