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 VisualStudio Intellisense error on RCSwitch (Read 4644 times)
Henrik Lauridsen
Newbies
*
Offline


Posts: 4
Joined: Jan 9th, 2017
VisualStudio Intellisense error on RCSwitch
Jan 9th, 2017 at 4:58pm
Print Post  
VisualStudio Intellisense error on RCSwitch

I have a problem with RCSwitch and Visual Micro in Visual Studio 2013.
Intellisense reports has no member errors .

IntelliSense: class "RCSwitch" has no member "enableReceive"
The same for “available”, “getReceivedValue”, ”getReceivedBitlength”, “getReceivedProtocol”

The Visual Micro installed is 1701.3.0

In Arduino ver. 1.6.12 there is no issues and it compiles without any problem.

Thank you in advance.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: VisualStudio Intellisense error on RCSwitch
Reply #1 - Jan 9th, 2017 at 6:57pm
Print Post  
Hi,

As you correctly say it is an intellisense error but the compile works correctly.

We hijack the Visual Studio intellisense for arduino so it is different from the compile.

The different versions of visual studio sometimes need small tweaks to fix intellisense errors. Can you confirm which board you are using and also email a small snippet or code or project with an example. Email is info[at]visualmicro.com or attach to a post here.

Thanks
  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: VisualStudio Intellisense error on RCSwitch
Reply #2 - Jan 9th, 2017 at 8:47pm
Print Post  
Thanks for the example

If you look in RCSwitch.h it uses "#if not defined". Visual Studio doesn't like the syntax and to be honest I have never seen the syntax in arduino code before. Press F12 or "GoTo Definition" to get to the RcSwitch.h and you will see this.

You can change the lib code from:-

Code
Select All
#if not defined( RCSwitchDisableReceiving ) 

  

To:-

Code
Select All
#ifndef RCSwitchDisableReceiving  

  

or I think the arduino team used #if !defined(var)

Hope this helps. By the way what is the name of the folder you installed the library into?


//RcSwitch.h
Code
Select All
#if not defined( RCSwitchDisableReceiving )
    void enableReceive(int interrupt);
    void enableReceive();
    void disableReceive();
    bool available();
    void resetAvailable();

    unsigned long getReceivedValue();
    unsigned int getReceivedBitlength();
    unsigned int getReceivedDelay();
    unsigned int getReceivedProtocol();
    unsigned int* getReceivedRawdata();
    #endif
 




//RcSwitch.h - Modified
Code
Select All
#ifndef RCSwitchDisableReceiving
    void enableReceive(int interrupt);
    void enableReceive();
    void disableReceive();
    bool available();
    void resetAvailable();

    unsigned long getReceivedValue();
    unsigned int getReceivedBitlength();
    unsigned int getReceivedDelay();
    unsigned int getReceivedProtocol();
    unsigned int* getReceivedRawdata();
    #endif
 






« Last Edit: Jan 9th, 2017 at 8:48pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Henrik Lauridsen
Newbies
*
Offline


Posts: 4
Joined: Jan 9th, 2017
Re: VisualStudio Intellisense error on RCSwitch
Reply #3 - Jan 9th, 2017 at 9:08pm
Print Post  
Thank you very much. I will try it right away.

The name of library folder was “rc-switch-master”, but I changed it to RCSwitch. 

The structure looks like this
See attachment please
  

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


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: VisualStudio Intellisense error on RCSwitch
Reply #4 - Jan 9th, 2017 at 9:25pm
Print Post  
Thanks, yes it will be okay after you change the .h code.

If you rename a library you will need to restart the ide or click the rescan button on the "visual micro explorer" but it will work with dashes and "master" in the name (which this one has)
« Last Edit: Jan 9th, 2017 at 10:02pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint