示例

struct MyStruct {
public:
void function(){}
int member;
 

};

解决方案
将结构构造为类。

class MyStruct {
public:
void function(){}
int member;
 

};