【发布时间】:2012-09-17 22:13:26
【问题描述】:
我收到此错误:
error C3767: 'phys1::point::get_prev': candidate function(s) not accessible
这是我的代码
物理.h
using namespace System;
namespace phys1 {
typedef struct position{
int x;
int y;
} pos;
public ref class point{
public:
point(float speed, float gr);
public:
pos get_prev();
public:
pos get_next();
};
}
phys.cpp
// This is the main DLL file.
#include "phys.h"
using namespace System;
namespace phys1 {
...
static pos point::get_prev(){
pos point;
point.x=x;
point.y=y;
return point;
}
...
}
我尝试在库中使用的结构是否有问题?我可以用其他方式构建它吗?
【问题讨论】:
-
static来自哪里?它不在类内的声明中!