What happens when I include an arduino library in a visual studio project

by Visual Micro 20. April 2010 17:05

 

The arduino ide allows libraries to be include in sketch programs using #include <libFolderName>. In normal programing this would refer to a <LibFileName.h> file in a library path. This does not work well for visual studio intellisense or build/compile.

 

Visual Micro solves this problem as follows

 

The #include in a .pde file is ignored and has no relevence in visual studio. The sole purpose of the #include library in a .pde maintains compatibility with the arduino ide

 

Visual Micro attaches the library files as files to a sketch project. When any code file is attached to a visual studio project it automatically is included in intellisense

 

When you add an arduino library to a visual studio project, Visual Micro modifies _vsaddin\include_libs.h with the path to the library.h file

 

 

The _vsaddin\include_libs.h file is also rebuilt when you build or compile a visual studio sketch project. This ensures any libraries you have manually attached to the project are included

 

Summary

 

The _vsaddin\include_libs.h is automatically maintained by visual micro and is used by the avr-gcc compiler to resolve references to arduino libraries

 

News - 2010

2nd May - Visual Studio 2010 - Navigating the Navigator with ArduPilot

18th April - Supports multiple sketch (pde) files in a single project (ArduPilot)

17th April - Supported on all windows language versions

14th April - First test success

11th April - The arduino visual studio beta was released today

Links and References

Visual Micro Forums here

Visit the Arduino forums here

A different solution here

Bob Powell's solution here

Ardupliot example here