I am getting compile error candidate function(s) not accessible
when calling certain members, although I declared them as public
.
I only get the error when some class from vtk is involved (as return type or as argument) and when the class to be called is not in the same VS-project as the calling code. I also tried other vtk types with no luck :(
Here is some test code:
// A.h, in a seperate class library
#include <vtkActor.h>
public ref class A
{
public:
A(void);
void test1(vtkActor* actor);
vtkActor* test2();
void test3(char* actor);
char* test4();
};
// B.h, Same as A but in the same project as the calling code
#include <vtkActor.h>
ref class B
{
public:
B(void);
void test1(vtkActor* actor);
vtkActor* test2();
void test3(char* actor);
char* test4();
};
I tried to call the functions from the same project B
is in like this:
// calls to class library
A^ testA = gcnew A();
testA ->test1(vtkActor::New()); // error
testA ->test2(); // error
testA ->test3(""); // ok
testA ->test4(); // ok
// calls to this project
B^ testB = gcnew B();
testB ->test1(vtkActor::New()); // ok
testB ->test2(); // ok
testB ->test3(""); // ok
testB ->test4(); // ok
In the two lines with //error this is the exact message:
error C3767: 'A::test1': candidate function(s) not accessible
How I can resolve this error? Why does it occur only on vtk-types?
kind regards, richn