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 "Add Library->User installed" option (Read 1919 times)
Pedro Henrique
Newbies
*
Offline


Posts: 5
Joined: Aug 18th, 2023
"Add Library->User installed" option
Aug 18th, 2023 at 2:58pm
Print Post  
Hi guys. 

I updated for Arduino 2 and VS2022 but now nothing happens when I click "Add Library->User installed" on my machine.

Sometimes, it only add includes on ino main file. 

Previously, it added a reference for package.

Where am i going wrong?

I am trying to compile attached code whichs depends on AsyncTCP, ESPAsyncWebServer and AsyncElegantOTA. The compiler cannot find them but they are installed.


----------------------------------------------------
More information:


Microsoft Visual Studio Community 2022
Versão 17.7.1
VisualStudio.17.Release/17.7.1+34009.444
Microsoft .NET Framework
Versão 4.8.09032

Versão Instalada: Community

Visual C++ 2022   00482-90000-00000-AA474
Microsoft Visual C++ 2022

Arduino IDE for Visual Studio by Visual Micro   22.0
Visual Micro is an Arduino Compatible IDE for Visual Studio 2022. For more information and forum please visit www.visualmicro.com.

ASP.NET and Web Tools   17.7.266.26423
ASP.NET and Web Tools

Cookiecutter   17.0.23189.3
Fornece ferramentas para localizar, instanciar e personalizar modelos no formato cookiecutter.

Depuração de Despejo de Núcleo do Linux   1.0.9.33920
Habilita a depuração de despejos de núcleo do Linux.

Ferramentas C#   4.7.0-3.23403.2+09841218a495cafad75ba163350d1e8949d8e5d6
Componentes de C# usados no IDE. Dependendo do seu tipo de projeto e configurações, uma versão diferente do compilador poderá ser usada.

Ferramentas do Serviço de Aplicativo do Azure v3.0.0   17.7.266.26423
Ferramentas do Serviço de Aplicativo do Azure v3.0.0

Ferramentas do TypeScript   17.0.20628.2001
Ferramentas do TypeScript para Microsoft Visual Studio

Ferramentas do Visual Basic   4.7.0-3.23403.2+09841218a495cafad75ba163350d1e8949d8e5d6
Componentes do Visual Basic usados no IDE. Dependendo do seu tipo de projeto e configurações, uma versão diferente do compilador poderá ser usada.

Gerenciador de Pacotes do NuGet   6.7.0
Gerenciador de Pacotes do NuGet no Visual Studio. Para obter mais informações sobre o NuGet, acesse https://docs.nuget.org/

Microsoft JVM Debugger   1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Python – suporte à criação de perfil   17.0.23189.3
Suporte à criação de perfil para projetos do Python.

Python com Pylance   17.0.23189.3
Fornece IntelliSense, projetos, modelos, depuração, janelas interativas e outros suportes para desenvolvedores do Python.

Visual C++ para Desenvolvimento em Linux   1.0.9.33920
Visual C++ para Desenvolvimento em Linux

Visual F# Tools   17.7.0-beta.23314.10+e612cf93b989503c89e3a5830090062b7ab5e143
Microsoft Visual F# Tools

Visual Studio IntelliCode   2.2
Desenvolvimento assistido por IA do Visual Studio.
  

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: "Add Library->User installed" option
Reply #1 - Aug 18th, 2023 at 3:17pm
Print Post  
Hello,

You only need the #include for an Arduino compatible build.

Previously you had enabled the library cloning and/or creation of shared projects. Many users did the same but without understanding the drawback of working that way. We moved the settings to the "Advanced Library" menu and also now show a warning when you attempt to enable the feature (s).

For most users it is important they do not use shared library projects. This is because when the library is updated via Library Manager the new version will not be used. It is also because when the selected board is changed the shared library source remains and will be invalid. 

There is a lot to consder when you use shared or cloned libraries. If your only goal is to see the sources of hidden libraries and/or core in the editor, then the best solution is to click vMicro>Show Hidden Files". 

"vMicro>Show Hidden Files" results in a more dynamic list of underlying library and core sources that Visual Micro will automatically update if a library, core or board is changed/updated.

If you decide to switch clone/shared libaries back on you should also consider other drawbacks. For example, the shared library projects will appear as References below the arduino project. Many users have experiment with different libraries as shared projects but subsequently removed the #includes but did not remove the Reference. The result being that a library would still be compiled even thought it is not used by the code.

The automatic library and core discovery is a reason why using the "arduino framework" is simpler than other solutions. The shared/cloned projects destroy that simplicity for all but a few users.

If you decide to work with "show hidden files" instead of the fixed shared/cloned libraries I suggest you "remove" the library projects from your solution explorer to avoid confusion.

Does this make sense?
  
Back to top
IP Logged
 
Pedro Henrique
Newbies
*
Offline


Posts: 5
Joined: Aug 18th, 2023
Re: "Add Library->User installed" option
Reply #2 - Aug 18th, 2023 at 5:18pm
Print Post  
I am still trying to understand it. The file AsyncTCP.h appears on src/libraries folder but it is not found on "Rede_Arduino.cpp" file. 

It is found only when #include is inserted on main ino file.

Still trying...
  

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: "Add Library->User installed" option
Reply #3 - Aug 18th, 2023 at 5:54pm
Print Post  
The output you posted was too large for a post, it needed to be attached as a .txt file.

It might be that you have switched off "vMicro>Compiler>Deep Search For Libraries" and that you are saying that another library you are using attempts to use AsyncTCP library. That would explain things. The deep search discovers #includes of libraries used by sources that are not in your own code. In the arduino ide the option is on and can not be switched off.

If that is not the issue please provide your build output as .txt or email with link to this thread. (see note in yellow at the top of this page)

Thanks
  
Back to top
IP Logged
 
Pedro Henrique
Newbies
*
Offline


Posts: 5
Joined: Aug 18th, 2023
Re: "Add Library->User installed" option
Reply #4 - Aug 18th, 2023 at 6:12pm
Print Post  
Thanks. I clearly understand what is happening now when I enabled the option to view the src/micro-api-readonly/libraries folder.

I had to re-add the libraries in the "add library" option on existing projects.

I added those lines on ino or h header file and it worked after reviewing libraries folder:

#include <AsyncTCP.h>
#include <ESPAsyncWebServer.h>
#include <AsyncElegantOTA.h>

Just a observation to others users if necessary about the code attached:
"AsyncElegantOTA.h" file has a object instantiation on header file in line 169: "AsyncElegantOtaClass AsyncElegantOTA;" causing linking erros due multiple definitions. I had to move it to cpp file.

Good day!

« Last Edit: Aug 18th, 2023 at 6:16pm by Pedro Henrique »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12186
Location: United Kingdom
Joined: Apr 10th, 2010
Re: "Add Library->User installed" option
Reply #5 - Aug 18th, 2023 at 6:21pm
Print Post  
I think there is some confusion.

The options "vMicro>Show Hidden Files" auto discovers the current board and code to determine what libraries and cores are being used. It then adds shortcuts to the solution so that you can see the code. If you click the Show Hidden Files again it will remove the shortcuts.

The shortcuts appear in the project as "src/micro-api-readonly/". They do not have any bearing on compilation, they are simply for you to see the sources. If you were to force the project to include the shortcuts by any other mechanism without an #include in your code then VS intellisense will accept them but the compile will be invalid.

For arduino, libraries are #included in code as, for example, #include <libName.h>. That is how arduino works.

Please remove the "src/micro-api-readonly" folder, add any #includes for libraries using the "Add Library" menu, "Platform Explorer" or manually as you have done. Click "vMicro>Show>Hidden Files" to view or hide them along with the "core" sources.

Does this now make sense or are we still missing your point?
  
Back to top
IP Logged
 
Pedro Henrique
Newbies
*
Offline


Posts: 5
Joined: Aug 18th, 2023
Re: "Add Library->User installed" option
Reply #6 - Aug 18th, 2023 at 8:13pm
Print Post  
I run more tests and it makes sense now. Thanks you.

"This is because when the library is updated via Library Manager the new version will not be used. "

I understand the consequences now.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12186
Location: United Kingdom
Joined: Apr 10th, 2010
Re: "Add Library->User installed" option
Reply #7 - Aug 18th, 2023 at 9:12pm
Print Post  
Great, it's not just the update via library manager. Sometimes there are library #includes based on #defines, and sometimes different microcontrollers use a different version of a library with same name. Shared libraries are okay if you want a fixed environment.
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint