[vtkusers] Strange compile problem for callback function based onvtkCommand

X Z xf10036 at hotmail.com
Thu Dec 15 09:07:41 EST 2005


When you're compiling in debug mode, VC tend to add
#define new DEBUG_NEW
to your source code. and
DEBUG_NEW in turn, is #defined as new(THIS_FILE, __LINE__)

On the other hand, operator new is defined in vtkObjectBase as

  void* operator new( size_t tSize );

which takes only one argument.  (There isn't a three argument operator new 
defined).


Xiaofeng Zhao





>From: Øystein Skotheim <oystein+vtk at edge.no>
>To: vtkusers at vtk.org
>Subject: [vtkusers] Strange compile problem for callback function based 
>onvtkCommand
>Date: Thu, 15 Dec 2005 11:56:23 +0100
>
>Hello. I am trying to write a callback function. According to the VTK
>User's Guide I derive it from vtkCommand.
>
>However, I get a strange compile error on the line that says "return new
>vtkMyCallback":
>
>error C2660: 'vtkObjectBase::operator new' : function does not take 3
>arguments
>
>Does anyone have a clue what is going on here? Below is the very simple
>code I tried to compile:
>
>class vtkMyCallback : public vtkCommand
>{
>public:
>   static vtkMyCallback* New() { return new vtkMyCallback; }
>   virtual void Execute(vtkObject *caller, unsigned long, void *callData)
>	{ printf("In Execute()"); }
>};
>
>I use Visual Studio .NET 2003 and VTK from the 5.0 branch in CVS.
>
>Regards,
>--
>
>Øystein Skotheim
>Scientist, Optical Measurement Systems and Data Analysis
>SINTEF ICT [http://www.sintef.com/omd]
>_______________________________________________
>This is the private VTK discussion list. Please keep messages on-topic. 
>Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>Follow this link to subscribe/unsubscribe:
>http://www.vtk.org/mailman/listinfo/vtkusers





More information about the vtkusers mailing list