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 unable to include arduino library file in cpp file (Read 3776 times)
timiadu_cph
Newbies
*
Offline


Posts: 4
Joined: Jul 4th, 2015
unable to include arduino library file in cpp file
Jul 4th, 2015 at 10:30pm
Print Post  
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
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: unable to include arduino library file in cpp file
Reply #1 - Jul 5th, 2015 at 3:19pm
Print Post  
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
« Last Edit: Jul 6th, 2015 at 1:52pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
timiadu_cph
Newbies
*
Offline


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