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 ArduinoJason library - Code links with Arduino 1.6.5 but not with Visual Micro (Read 3980 times)
DomoArigato
Newbies
*
Offline


Posts: 2
Joined: Feb 4th, 2016
ArduinoJason library - Code links with Arduino 1.6.5 but not with Visual Micro
Feb 4th, 2016 at 7:35pm
Print Post  
I'm having problems compiling/linking a piece of code using visual micro for Aduino. I've narrowed it down to the ArduinoJSON library. I installed the json library as I've installed other libraries, by downloading the ZIP file and then installing the library as a zip. Once I do that the library, its examples etc are available. I then open the JsonParserExample, and compile it under the arduino 1.6.5 GUI, and it compiles/links fine. When I load the exact .ino file into VS pro 2015, running Arduino for Visual Studio 1.0, I get the following errors:

JsonParserExample.ino:In function `setup
JsonParserExample.ino:parseObject(char*, unsigned char)
JsonParserExample.ino:In function `get<char const*>
JsonObject.ipp:JsonObjectKey) const
JsonObject.ipp:as<char const*>() const
JsonParserExample.ino:In function `get<long int>
JsonObject.ipp:JsonObjectKey) const
JsonParserExample.ino:In function `as<long int>
JsonVariant.ipp:asInteger() const
JsonParserExample.ino:In function `get<ArduinoJson::JsonArray&>
JsonObject.ipp:JsonObjectKey) const
JsonObject.ipp:_invalid
JsonObject.ipp:_invalid
JsonParserExample.ino:In function `get<double>
JsonArray.ipp:getNodeAt(unsigned int) const
JsonParserExample.ino:In function `as<double>
JsonVariant.ipp:asFloat() const
JsonParserExample.ino:In function `get<ArduinoJson::JsonArray&>
JsonObject.ipp:JsonObjectKey) const
JsonObject.ipp:_invalid
JsonObject.ipp:_invalid
JsonParserExample.ino:In function `get<double>
JsonArray.ipp:getNodeAt(unsigned int) const
JsonParserExample.ino:In function `as<double>
JsonVariant.ipp:asFloat() const
collect2.exe*:error: ld returned 1 exit status
Error creating .elf

In comparing the verbose output from the arduino build against the vs2015/vm build, the main difference is that the VM build is not building the json library, and hence its not linking to the json library.  This is the first issue I've had with the Visual Micro plugin. I am continuing to program with the Arduino GUI, but its just not as nice.

I'd appreciate any help or insights anyone might be able to give me ...
« Last Edit: Feb 4th, 2016 at 10:21pm 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: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: ArduinoJason library - Code links with Arduino 1.6.5 but not with Visual Micro
Reply #1 - Feb 4th, 2016 at 10:33pm
Print Post  
Thanks for the good info. It's fixed in next release but this one made me laugh Smiley 

note: See the workaround at the end of this post for a quick fix.

May 2015 Visual Micro was patched because the ArduinoJson library was a version 1.0 library but contained arduino version 2.0 library format structure which it required the Ide to ignore.

Now the ArduinoJson library is version 2.0 format but contains a version 1.0 format file that it requires the Ide to ignore.

I have removed the patch from Visual Micro which means the Visual Micro code is clean again. Great!

What visual micro now does is detect the "\src" folder in "C:\Users\David\Documents\Arduino\libraries\ArduinoJson-master\src" to determine a version 2.0 library

The older patch that you have, instead looks for a ".h" file in "C:\Users\David\Documents\Arduino\libraries\ArduinoJson-master" to determine version 1.0 and not 2.0 library.

and guess what! There is a "C:\Users\David\Documents\Arduino\libraries\ArduinoJson-master\ArduinoJson.h" that does not do anything, is not used and should not be there.

Workaround

1. Rename "C:\Users\David\Documents\Arduino\libraries\ArduinoJson-master\ArduinoJson.h" to "ArduinoJson.x" or delete it.

2. Click "tools>visual micro>reload tool chains" or restart the ide.


« Last Edit: Feb 4th, 2016 at 10:35pm by Tim@Visual Micro »  
Back to top
IP Logged
 
DomoArigato
Newbies
*
Offline


Posts: 2
Joined: Feb 4th, 2016
Re: ArduinoJason library - Code links with Arduino 1.6.5 but not with Visual Micro
Reply #2 - Feb 5th, 2016 at 9:04pm
Print Post  
Workaround worked like a charm! Thanks for the explanation as well. Cheers. Smiley
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint