title: why is "candidate function(s) not accessible" although declared public
body: <p>I am getting compile error <code>candidate function(s) not accessible</code> when calling certain members, although I declared them as <code>public</code>.
  I only get the error when some class from <a href="http://www.vtk.org/" rel="nofollow">vtk</a> 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 :(</p>
  
  <p>Here is some test code:</p>
  
  <pre><code>// A.h, in a seperate class library
  #include &lt;vtkActor.h&gt;
  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 &lt;vtkActor.h&gt;
  ref class B
  {
  public:
      B(void);
  
      void test1(vtkActor* actor);
      vtkActor* test2();
      void test3(char* actor);
      char* test4();
  };
  </code></pre>
  
  <p>I tried to call the functions from the same project <code>B</code> is in like this:</p>
  
  <pre><code>// calls to class library
  A^ testA = gcnew A();    
  testA -&gt;test1(vtkActor::New());  // error
  testA -&gt;test2();                 // error
  testA -&gt;test3("");               // ok
  testA -&gt;test4();                 // ok
  
  // calls to this project
  B^ testB = gcnew B();
  testB -&gt;test1(vtkActor::New());  // ok
  testB -&gt;test2();                 // ok
  testB -&gt;test3("");               // ok
  testB -&gt;test4();                 // ok
  </code></pre>
  
  <p>In the two lines with //error this is the exact message:</p>
  
  <pre><code>error C3767: 'A::test1': candidate function(s) not accessible
  </code></pre>
  
  <p>How I can resolve this error? Why does it occur only on vtk-types?</p>
  
  <p>kind regards,
  richn</p>