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 trouble with headers (Read 3128 times)
jimf
Junior Member
**
Offline


Posts: 20
Joined: May 30th, 2015
trouble with headers
May 30th, 2015 at 4:52am
Print Post  
I am having trouble getting headers recognized....appreciate any help.  I want to have a global header that defines class variables that are used in both libraries and main loop. I use the timer class and LiquidCrystal class and the instantiated objects need to be accessible by a library and within the main loop.  My strategy is to create a global header with all the includes and defining the variables as extern in the global header, and declaring them in the .ino file.  The idea is that by defining them in the global header, all .cpp files will recognize them. By declaring them in the .ino file, they will only be instantiated once.  I've been hacking away for a while and am still not getting it to work.

A turned on the verbose errors and it looks like the headers are not being seen.  i've tried adding them to the project, adding them as libraries, still not working.  Appreciate any direction you can give. The attached .doc file has the global variable header, the start of the .ino file, the error, and how the project files are set up.  Thanks in advance......jimf

  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: trouble with headers
Reply #1 - May 30th, 2015 at 11:54am
Print Post  
Hi,

Thanks for the clear info. I think the best answers for you will come from the arduino.cc forum where there are some c++ experts

I have only seen this happen when users create a library that is then #included in all other libraries that need to use the code and most importantly #included in the main sketch.ino. (note: for arduino, only libs included in the main sketch are compiled)

One thing that might help but isn't arduino compatible is to use the F4 visual micro project constants/defines to enable/disable your extended functionality. Visual micro passes the project defines to the compilation of all sources.

Sorry I can't be more help
  
Back to top
IP Logged
 
jimf
Junior Member
**
Offline


Posts: 20
Joined: May 30th, 2015
Re: trouble with headers
Reply #2 - May 30th, 2015 at 5:43pm
Print Post  
thanks for your input...I'll take your advice and post on the arduino.cc forum.  cheers....jim
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint