[vtkusers] vtkStandardNewMacro Issue?

David Doria daviddoria at gmail.com
Fri Sep 7 11:15:29 EDT 2012

On Fri, Sep 7, 2012 at 11:02 AM, Alessandro <notinmyhead at gmail.com> wrote:

> Hello,
> I'm trying to develop a custom InteractoryStyle in a QT application,
> following the example:
> http://www.vtk.org/Wiki/VTK/Examples/Cxx/Interaction/SelectAnActor
> If I build my application up from a clean project, it appears to work
> properly. After few compilation, I get a linker error of duplication of
> MyCustomInteractorStyle::New() both in myapplication.o and main.o. Why?
> Thanks,
> Ale

You should have a MyCustomInteractorStyle.cxx where
this MyCustomInteractorStyle::New() appears so that it is made into its own
object (MyCustomInteractorStyle.o). Then this object should be linked to
everything else by the linker. Which file in your project does
the MyCustomInteractorStyle::New() appear in? And can you show us the
add_executable and target_link_libraries lines of your CMakeLists.txt?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120907/3a031443/attachment.htm>

More information about the vtkusers mailing list