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 Standard Arduino core #includes when working in Library Projects (Read 2393 times)
AlexBraun
Newbies
*
Offline


Posts: 4
Location: Ukraine
Joined: Nov 7th, 2018
Standard Arduino core #includes when working in Library Projects
Nov 7th, 2018 at 9:19am
Print Post  
Hi.
I am creating an Arduino library project.
But in the code window, an error is immediately highlighted, indicating that the standard Arduino libraries were not found.
Unable to open source file "Arduino.h"
At the same time, the library connects to the sketch code and works fine.
What could be the problem?
« Last Edit: Nov 7th, 2018 at 10:05pm by Tim@Visual Micro »  

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


Posts: 12201
Location: United Kingdom
Joined: Apr 10th, 2010
Re: The visibility problem of the standard Arduino libraries
Reply #1 - Nov 7th, 2018 at 1:39pm
Print Post  
There are many ways to create a library project. Please explain what you have created and your solution or zip it and attach it to a reply here or email to info[at]visualmicro.com along with link to this thread.
  
Back to top
IP Logged
 
AlexBraun
Newbies
*
Offline


Posts: 4
Location: Ukraine
Joined: Nov 7th, 2018
Re: The visibility problem of the standard Arduino libraries
Reply #2 - Nov 7th, 2018 at 4:50pm
Print Post  
Thanks for the quick response.
I create a library in a standard way from the start window.



I choose to create a new Arduino library project.
I write the name and click "OK"



New .h and .cpp files are created.
But they emphasize that there is no access to the installed libraries.



If I try to insert the library by myself, I see that the system is looking for them in the directories c:\\Program Files (x86)\ ... and d:\\ProgramFiles (x86)\ .....




And there is nowhere mention of the directories of the Arduino libraries.
Maybe I need to specify somewhere, so that the system would look for library files in other directories?

Thank you.
« Last Edit: Nov 7th, 2018 at 5:05pm by AlexBraun »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12201
Location: United Kingdom
Joined: Apr 10th, 2010
Re: The visibility problem of the standard Arduino libraries
Reply #3 - Nov 7th, 2018 at 5:24pm
Print Post  
Which board have you got?
  
Back to top
IP Logged
 
AlexBraun
Newbies
*
Offline


Posts: 4
Location: Ukraine
Joined: Nov 7th, 2018
Re: The visibility problem of the standard Arduino libraries
Reply #4 - Nov 7th, 2018 at 6:23pm
Print Post  
I use ESP32, but switching to other devices, such as Uno, does not change anything in the code.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12201
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Standard Arduino core #includes when working in Library Projects
Reply #5 - Nov 7th, 2018 at 7:52pm
Print Post  
Currently the arduino.h header from the arduino core can not be found in your library because you have not added a normal arduino project that uses the library.

The readme in the new library project that you have created gives you some ideas. It says the library works like a normal arduino library. An Arduino library is not a self contained executable project and it not tied to any specific hardware.

You need to add an arduino project to your solution so that you have both a standard arduino project and the library project. Then follow the readme which explains how to add a reference between the arduino project and the library project so that a) intellisense can work and b) your arduino project can find the library outside of the official arduino library locations

You can negate b) is you ensure the library is created below an official arduino libraries location such as mydocument\arduino\libraries. In this way the arduino ide will also then be able to see your library. However you can right click > publish  on the library.properties file to have the library automatically copied to the official location at a time of your choosing.

Visual Studio has the concept of a "Startup Project". The Startup project name is shown in the solution explorer in bold. A library project will use the board/hardware selection of the Startup project if the reference mentioned earlier has been added.

This enables you to have a solution with one or more library projects referenced from one or more Arduino projects. Each Arduino project might have a different board assigned. When developing the library the intellisense will be for the board of the Startup project.

note: I have changed the subject of this thread. I suggest that you do not refer to .h files as libraries when discussing arduino  Smiley
« Last Edit: Nov 7th, 2018 at 10:05pm by Tim@Visual Micro »  
Back to top
IP Logged
 
AlexBraun
Newbies
*
Offline


Posts: 4
Location: Ukraine
Joined: Nov 7th, 2018
Re: Standard Arduino core #includes when working in Library Projects
Reply #6 - Nov 7th, 2018 at 8:27pm
Print Post  
You are the best!!!  Cheesy
I thought about the problem all day and tried to solve it. And you suggested an elementary solution and everything turned out perfectly.
I added the library to the working project and indicated a link to it in the References.
Thank you very much!!!!
« Last Edit: Nov 7th, 2018 at 10:05pm by Tim@Visual Micro »  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint