VS Arduino | |
>> >> Issue with libraries
https://www.visualmicro.com/forums/YaBB.pl?num=1439503851 Message started by Massimo S on Aug 13th, 2015 at 10:10pm |
Title: Issue with libraries Post by Massimo S on Aug 13th, 2015 at 10:10pm
Sorry team but I feel dummy... I'm not able to get my simple code compile.
I've read all the documentation etc... This is the code: Code (]#include"AltSoftSerial\AltSoftSerial.h" AltSoftSerial test1; void setup() { /* add setup code here */ } void loop() { /* add main program code here */ } [/code):
If I change it to this: Code (]#include"AltSoftSerial.h"[/code):
Can you please help me? I do really feel dummy Note that this [code]#include<AltSoftSerial.h> AltSoftSerial test1; void setup() { /* add setup code here */ } void loop() { /* add main program code here */ } [/code] compiles correctly in the arduino ide Quote:
but does not compile in Visual Studio I followed the standard configuration on the Visual Studio plugin. |
Title: Re: Issue with libraries Post by Visual Micro on Aug 13th, 2015 at 10:23pm
Hi,
If you open the visual micro ide locations window you will see that you specified the location of the arduino ide. Below the ide location field is an optional field called sketchbook folder. Is the field empty or does it contain a value? Which version of the arduino ide are you using? Thanks |
Title: Re: Issue with libraries Post by Massimo S on Aug 14th, 2015 at 7:55am
I left the dafeault configuration so the sketchbook folder is empty.
For the version I left the default option and it should be Arduino 1.6 M |
Title: Re: Issue with libraries Post by Visual Micro on Aug 14th, 2015 at 1:49pm
The correct include should be:-
[code]#include <AltSoftSerial.h>[/code] But you should use the menus to insert it for you so you can see the format and ensure the library is being discovered. Remove the #include and then click "Project>Add Arduino Library". Do you see the library on the User or Core menu? If not, open the "Micro Explorer", expand your board and tell me if you see the library listed under libraries? If you can not see the library can you confirm it exists in c:\users\[your name]\documents\arduino\AltSoftSerial.h |
Title: Re: Issue with libraries Post by Massimo S on Aug 14th, 2015 at 1:57pm
Ok.
I did cancelled the line and used the AddLibrary / User it added a line [code] #include <AltSoftSerial.h> [/code] and now it worked... very weird! |
Title: Re: Issue with libraries Post by Visual Micro on Aug 14th, 2015 at 2:05pm
Thanks, I will look into it. Maybe it's a problem with " instead of < or maybe that you did not have a any whitespace between #include and "lib.h"
You can try it easily enough. Now you know the correct syntax/format you can easily make it work or break it :) ??? by the way, unlike visual micro, the arduino ide does not show an error if it can not find a library but the library can't be used. |
Title: Re: Issue with libraries Post by Visual Micro on Aug 14th, 2015 at 4:42pm
I tested this.
If there is no space/tab/gap between the #include and the <library.h> or "library.h" then Visual Micro fails to compile This works:- Code (]#include <lib.h> #include "lib.h"[/code):
Thanks for the report |
VS Arduino » Powered by YaBB 2.6.12! YaBB Forum Software © 2000-2024. All Rights Reserved. |