[Paraview] problems linking a new filter

Moreland, Kenneth kmorel at sandia.gov
Fri Sep 5 14:21:45 EDT 2008


In the source you posted previously, you had the New method defined in the
header file.  The vtkStandardNewMacro also defines the New method.  The
linker is complaining that you have made two different implementations of
the New method.

In your header file, change the line

  static vtkHorizontalAverage *New(){return new vtkHorizontalAverage;}

To

  static vtkHorizontalAverage *New();

-Ken


On 9/4/08 2:55 PM, "Natalie Happenhofer" <nataliehapp at hotmail.com> wrote:

> Well,
> I added the vtkStandardNewMacro(vtkHorizontalAverage) -that´s the right
> parameter, isn´t it?
> and now I get many compiler errors, like
>
> 'static *vtkHorizontalAverage vtkHorizontalAverage::New()' and
> 'vtkHorizontalAverage* vtkHorizontalAverage::New()' cannot be overloaded
>
> - is it now twice defined?
>
> enother error:
>
> storage class specified for field "vtkInstantiatorvtkHorizontalAverageNew()"
>
> and
>
> vtkObjectFactory was not declared
> CreateInstance() was not declared in this scope
>
> what did I get wrong now?
>
> thx,
> NH
>
>
>
>> Date: Thu, 4 Sep 2008 14:13:11 -0400
>> From: berk.geveci at kitware.com
>> To: nataliehapp at hotmail.com
>> Subject: Re: [Paraview] problems linking a new filter
>> CC: paraview at paraview.org
>>
>> vtkStandardNewMacro() includes
>> vtkInstantiatorvtkHorizontalAverageNew(). You are missing that symbol
>> because you didn't use the macro.
>>
>> -berk
>>
>> On Thu, Sep 4, 2008 at 5:27 AM, Natalie Happenhofer
>> <nataliehapp at hotmail.com> wrote:
>>> Hello,
>>> I have written a new filter and put in the method New():
>>>
>>> static vtkHorizontalAverage *New() {return new vtkHorizontalAverage;}
>>>
>>> it is in the header-file vtkHorizontalAverage.h, HorizontalAverage is the
>>> new filter.
>>> As there is already the definition there, there is nothing else concerning
>>> New() in the corresponding .cxx-file.
>>>
>>> Now building paraview with that filter, it compiles fine, but linking I get
>>> the following error:
>>>
>>> Linking CXX Executable ..\..\..\bin\ServerManagerStateLoader.exe:
>>> ..\bin\libvtkPVFilters.a(vtkPVFiltersInstantiator.obj):vtkPVFiltersInstantia
>>> tor.cxx:
>>> undefined reference to 'vtkInstantiatorvtkHorizontalAverageNew() '
>>>
>>> What can I do to avoid that? Is there any file I need to include
>>> additionally, or.. ??
>>> thx for help,
>>> NH
>>>
>>> ________________________________
>>> Express yourself instantly with MSN Messenger! MSN Messenger
>>> _______________________________________________
>>> ParaView mailing list
>>> ParaView at paraview.org
>>> http://www.paraview.org/mailman/listinfo/paraview
>>>
>>>
>
>
> Express yourself instantly with MSN Messenger! MSN Messenger
> <http://clk.atdmt.com/AVE/go/onm00200471ave/direct/01/>




More information about the ParaView mailing list