Problem in Dynamic Library

I took out all AutoInit. I incrementally removed the lines in error (AutoInit). Until have none.
One question. Is this code correct?

    vtkSmartPointer<vtkImageConnectivityFilter> connectivity[4];
    for (i1=0;i1 <4 ;i1++)
        connectivity[i1]=  vtkSmartPointer<vtkImageConnectivityFilter>::New();

Error:

OSError: .//server//vtkpython//testlib.so: undefined symbol: _ZN26vtkImageConnectivityFilter3NewEv