Visual Micro
Other >> Project Guidance >> Using the <string> library?

Message started by laszlo.frank on Jun 26th, 2017 at 12:45pm

Title: Using the <string> library?
Post by laszlo.frank on Jun 26th, 2017 at 12:45pm
I have the same issue with #include <string>.  :(
Output is :
Compiling debug version of 'Firmata' for 'Arduino Leonardo'

Firmata.ino: 9:18: fatal error: string: No such file or directory
   #include <string>
   compilation terminated
Debug build failed for project 'Firmata'

Deep search enabled, version is 1705.8. If I r-click <string> in VS and select "Open Document <string>" it opens, so VS knows the location.

Why is that so difficult to vMicro when the library is on the standard VC++ include path ? Is there a final solution to the above please ?

Thank you in advance.

Title: Re: Adding Library in Lib
Post by Visual Micro on Jun 27th, 2017 at 12:19pm
<string> is not part of the arduino tool chain. Visual Studio sometimes shows some windows intellisense which is not valid. You can see this easily because the path of the source code is not an arduino folder.

It's best to start with documentation for functions you want to use because the docs will also tell you which arduino source files to include.

Title: Re: Adding Library in Lib
Post by laszlo.frank on Jun 28th, 2017 at 8:30am
Thank you for the explanation, sad though.

Title: Re: Adding Library in Lib
Post by Visual Micro on Jun 28th, 2017 at 10:32am
I forgot to say that detection of lib code changes should also work better with the recent releases even in vs2013. There have been a lot of improvements since a year ago when you last installed the software.

As for the detection of new source code files that have been added to libraries, you should use vs2015 or 2017 because the shared project system works very nicely for arduino libraries that can be located in any folder.

Finally bear in mind that the "Build>Clean" commands clear out the compiler cache, that works even in your ancient version of the software and that the "reload tool chains" command will detect all lib changes (even newly added files).

Don't forget that vs2015 and 2017 are free so no excuse for not upgrading :)

Visual Micro » Powered by YaBB 2.5.2!
YaBB Forum Software © 2000-2020. All Rights Reserved.