Welcome, Guest. Please Login or Register
Arduino IDE for Visual Studio
 
 
When Logging a Support Issue in the Forum, please ensure you have also:-
  • Enabled vMicro > Compiler > Show Build Properties and Verbose
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
Support requests without the output above may be impossible to answer, so please help us to help you
 
  HomeSearch Tutorials & Wiki visualmicro.com LoginHelpRegister  
 
Page Index Toggle Pages: 1
Send Topic Print
unable to include arduino library file in cpp file (Read 2760 times)
timiadu_cph
Newbies
*
Offline



Posts: 4
unable to include arduino library file in cpp file
Jul 4th, 2015 at 11:30pm
 
I am trying to add an arduino library file (UTFT.h) to my project. To be precise, I am trying to add this library file to a cpp file, which is a part of the project. But i noticed that the library gets included in the main sketch.ino file, and not the cpp file i want. How do i get around this? Smiley
Back to top
 
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10529
United Kingdom
Re: unable to include arduino library file in cpp file
Reply #1 - Jul 5th, 2015 at 4:19pm
 
The way Arduino works is that libraries are only discovered if added to a .ino file. Normally you added them at the top of the .ino.

You can use the explorer or the "project>add/import library" menu to add imports if unsure what to add.

If they can be discovered from .ino then they can also be #included into .cpp and .h files
Back to top
« Last Edit: Jul 6th, 2015 at 2:52pm by Visual Micro »  
WWW  
IP Logged
 
timiadu_cph
Newbies
*
Offline



Posts: 4
Re: unable to include arduino library file in cpp file
Reply #2 - Jul 6th, 2015 at 2:44pm
 
Super!  It works. Thanks
Back to top
 
 
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print