<div class="gmail_quote">On Mon, Apr 30, 2012 at 9:42 AM, Wenlong Wang <span dir="ltr"><<a href="mailto:scc.wwl@gmail.com" target="_blank">scc.wwl@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
It is a regular console application. It goes like<br><br>#include <vtkxxx.h><br>//.............<br>//---------- Include headers -----------------<br><br>vtkPolyData* polydata = vtkPolyData::New(); // here pops the error<br>
//............ <br><br>void main()<br>{<br> //.........................................<br>}<br></blockquote><div><br></div><div><br></div>New() is a function. You can't call a function outside of a scope like you have done there in c++. For example, this doesn't compile either:</div>
<div class="gmail_quote"><br></div><div class="gmail_quote"><div class="gmail_quote">void MyFunction() {}</div><div class="gmail_quote"><br></div><div class="gmail_quote">MyFunction(); // You can't do this</div><div class="gmail_quote">
<br></div><div class="gmail_quote">int main()</div><div class="gmail_quote">{</div><div class="gmail_quote"> return 0;</div><div class="gmail_quote">}</div><div><br></div><div><div>My compiler says "error: expected constructor, destructor, or type conversion before ‘;’ token" - I would expect yours says something more than "access conflict" as well.</div>
</div><div><br></div>
David<br></div>