Issue with calling C++ static class member function

Hi,

I have a C++ class with code as in below:

//.h file
class Model_Server
{
    public:
           static void Command_Handler( );
};

//.cpp file
void Model_Server::Command_Handler(  )
{
    printk( "Received command. \n ");
}

This I need to call in a .c file, which I did with extern "C" definitions with a C wrapper as in below:

//.c file
#ifdef __cplusplus
extern "C" {
#endif 
void Wrapper()
{
	Model_Server::Command_Handler( );
}
#ifdef __cplusplus
}
#endif

I am getting errors if I compile this, same above static class member function I am able to call in a .cpp file and build successfully.

But I am unable to call in .c file. 

The errors I am getting when calling from .c file are:
1. In class declaration : 


2. In .c wrapper function where I am calling static class member function I am getting the error "
 at the scope resolution operator  

Model_Server::Command_Handler( );


Kindly help me solve this.
P.S: CMakeLists & prj.conf are in order and I have enabled C++ support, auto-complete feature is also working I am able to go to static class member function definition by clicking on the function call & like I said same call builds fine in .cpp file.
Thanks

 

Parents Reply Children
No Data
Related