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 Include libraries multiple times? (Read 2630 times)
Kucky
Junior Member
**
Offline


Posts: 50
Location: Germany
Joined: Oct 12th, 2012
Include libraries multiple times?
Feb 11th, 2014 at 2:03pm
Print Post  
I hope I'm right here?
I use very successfully visual micro and debugtool. But I have a question about the libraries. When adding libraries the #includes are automatically added to the master .pde source. If I want to use a library in a subclass, this library must then be included in both classes?
Best regards
Kucky
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12198
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Include libraries multiple times?
Reply #1 - Feb 11th, 2014 at 2:10pm
Print Post  
Hi Kucky,

Thanks for the message.

You do not need to #include the libraries in any other .pde/.ino sources than the master. This is because during compilation all .ino files are combined into a single .cpp. This means that all includes, variables and methods are automatically shared between all .ino files.

However if you are using your own .h/.cpp files then you do need to #include the libraries in each of the .h/.cpp sources that reference the library.

Intellisense should support this by providing library intellisense in all .pde/.ino files even if the #include is in the master?
  
Back to top
IP Logged
 
Kucky
Junior Member
**
Offline


Posts: 50
Location: Germany
Joined: Oct 12th, 2012
Re: Include libraries multiple times?
Reply #2 - Feb 11th, 2014 at 5:36pm
Print Post  
Hey Tim,
Thank you for the quick reply. I have this also suspected. Now, I'm sure.

Have a nice evening.
Kucky
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint