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) Library error (Read 6617 times)
Danie1
Junior Member
**
Offline


Posts: 20
Joined: Jan 12th, 2022
Re: Library error
Reply #20 - Oct 19th, 2023 at 7:23pm
Print Post  
Are you talking about the -I includes? They are necessary as most of the code resides outside of where the .ino file lies. (and they are all added into the Visual Studio solution so they are compiled).
However, the file with the not-found #include and the ino file are in the same directory, the base directory of the project.

I am not able to reproduce the same issue with a fresh project, even with the files in different projects.
I think my issue comes from the fact that the path from ino -> file-with-the-library-include is a little a-typical for Arduino projects. Somehow, it seems to be covered by my board.txt with the "all" settings (at least this is my explanation right now, you probably have a better insight in how this works).

So unless I restructure my project, it might not be possible to resolve this other that with my custom board.txt.

Thanks for your quick messages, helping me to unterstand the issue Smiley
Daniel
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12186
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Library error
Reply #21 - Oct 19th, 2023 at 8:23pm
Print Post  
I think I see. Can you give an idea of your code structure. For example:-

project
project\src
project\src\folder1

You are saying that libraries are not auto discovered from project code located in "project\src\folder1" unless you use the "all" option?

« Last Edit: Oct 19th, 2023 at 8:59pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Danie1
Junior Member
**
Offline


Posts: 20
Joined: Jan 12th, 2022
Re: Library error
Reply #22 - Oct 20th, 2023 at 6:37pm
Print Post  
So my project structure looks as follows (reduced view):
Code
Select All
0) solution
1)   libwinston
2)     libwinston.h       <-- includes ../winston-teensy/winston-teensy.h via platform-define
3)   winston-teensy
4)     winston-teensy.ino <-- includes ../libwinston/libwinston.h
5)     winston-teensy.h   <-- includes <WebSockets2_Generic.h>
6)   winston
7)     winston-x64.cpp <-- includes ../libwinston/libwinston.h
 


libwinston contains my application code. winston-teensy is the Visual Micro/arduino project directory with the ino file. winston is the same application for x64, also including the libwinston files.
All relevant files are added to the solution in Visual Studio.

As I am said, I am not sure about how the deep-scan functionality works, but maybe the issue is the winston-teensy.h being referenced via a file not in the same directory as the ino?

However, I used the same setup in January 23 where the same structure was in place (with Arduino IDE 1.8 and the Visual Micro version of that time) and I did not have this problem.

Is it possible to set the lib-search=all parameter via a UI control? "Super deep library search" or something?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12186
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Library error
Reply #23 - Oct 21st, 2023 at 5:05pm
Print Post  
Thanks for the info. We are going to add a couple of comboboxes to the vMicro>general that allows nusers to controller how deep "deep search" goes.

It sounds like you have a library that includes another library from code deep er than the root of the library. As you found, you do need these options at the moment because the default only searches the first level. This is because platforms such as esp32 are so slow which causes long compile times when nothing has changed. 

vm.preproc.lib-search.lib-in-lib=all
vm.preproc.lib-search.lib-in-sketch=all 

We might also add a button that performs a full deep search, but for when users know they have added new libraries to their code. At other times an automatic full deep search will happen when board or defines change. It might be a better solution.

As a side note, user installed libraries should be in the sketchbook\libraries folder and relative or physical paths are not really in the arduino spec. Only the headers should be in the include, for example #include <Lib1.h>

The v64 and VS project property property page settings are used only for intellisense. You should never need to add any -I compiler includes. 

Assming you have set the "all" settings, you should find the exact same code compiles in both arduino ide and visual micro.


  
Back to top
IP Logged
 
Danie1
Junior Member
**
Offline


Posts: 20
Joined: Jan 12th, 2022
Re: Library error
Reply #24 - Oct 23rd, 2023 at 3:24pm
Print Post  
Thank you. Maybe I can update my project structure accordingly.
Looking forward to the new settings Smiley
I was just very puzzled why my setup did not work any longer.

Best Regards
Daniel
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1 [2] 
Send TopicPrint