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 #ifdef / #ifndef preprocessor directives issue (Read 4433 times)
Kovy
Newbies
*
Offline


Posts: 6
Joined: Sep 18th, 2016
#ifdef / #ifndef preprocessor directives issue
Sep 18th, 2016 at 3:02pm
Print Post  
Hello, I hope to report issue with VisualMicro and "#ifdef" or "#ifndef" preprocessor directive. I have defined "internal" Arduino's callback function named "serialEvent1". I want to simply switch to include or not for compile. However, compiler always found and compile this "internal" function, regardless of state conditional block. When conditions met to not including this function and in editor is this piece of code displayed with gray color, so even compiler found it and compile with other code. I workarounded it renaming this function for examle "XserialEvent1".


I attached screenshot...

Thanks for any ideas.


Peter
  

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


Posts: 12186
Location: United Kingdom
Joined: Apr 10th, 2010
Re: #ifdef / #ifndef preprocessor directives issue
Reply #1 - Sep 18th, 2016 at 3:25pm
Print Post  
Hi,

Normally for arduino it only supports defines in code files but Visual Micro also offers a number of properties for defines via the Visual Micro project properties.

The standard Visual Studio project properties are readonly otherwise we wouldn't be able to auto update them for intellisense.

You can find the Project Properties via the vMicro menu. They are documented in the main documentation index

http://www.visualmicro.com/page/User-Guide.aspx?doc=Project-Properties-Reference...

If you are using the Visual Micro project properties then please confirm which one contains your define(s)


  
Back to top
IP Logged
 
Kovy
Newbies
*
Offline


Posts: 6
Joined: Sep 18th, 2016
Re: #ifdef / #ifndef preprocessor directives issue
Reply #2 - Sep 18th, 2016 at 7:12pm
Print Post  
Hello, thank You for Your speedy reply. Iam very sorry. Mistake is on my side, not in VisualMicro. First I defined symbol directly in *.ino file, not via Project Properties. 

"Problematic" part of code was in another (*.cpp) file, where not exist any link to first file with my #define.

Now I corrected this mistake and all works very fine.

Thanks and have a nice day, Peter.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12186
Location: United Kingdom
Joined: Apr 10th, 2010
Re: #ifdef / #ifndef preprocessor directives issue
Reply #3 - Sep 18th, 2016 at 7:23pm
Print Post  
Good thanks for update šŸ˜€
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint