[vtkusers] linking problem while extending VTK

francesco caruso guernika_devel at yahoo.it
Wed May 11 07:48:41 EDT 2005


Hello VTK USERS

I'm trying to extend VTK creating a new class
called vtkARWindow, that own two overlapped renderers.

when i try to compile I get this error:

vtkARWindow.o(.text+0x69): In function 
`vtkARWindow::vtkARWindow[not-in-charge]()':
: undefined reference to `vtable for vtkARWindow'
vtkARWindow.o(.text+0x159): In function 
`vtkARWindow::vtkARWindow[in-charge]()':
: undefined reference to `vtable for vtkARWindow'
collect2: ld returned 1 exit status

If I used objectfactory instead of normal constructor
I shouldn't obtain this error?

Any kind of help will be appreciated!!!

I hope you don't mind if I attach some line of code...

//vtkARWindow.h
#ifndef VTK_AR_WINDOW
#define VTK_AR_WINDOW

#include "vtkXOpenGLRenderWindow.h"
#include "vtkRenderer.h"
#include "vtkARImageRenderer.h"

class vtkARImageRenderer;

class vtkARWindow : public vtkXOpenGLRenderWindow {
	public: //VARS
		vtkRenderer* ImageRenderer;
		vtkRenderer* VirtObjRenderer;
	//public: //METHODS
		static vtkARWindow* New() { return new vtkARWindow;};
		vtkARWindow();
		~vtkARWindow();
//		void SetImageRenderer(vtkARImageRenderer* ren);
//		void SetVirtObjRenderer(vtkRenderer* ren);
		void SetImage(unsigned char* image);
		
		//void vtkARWindow(const vtkARWindow &w);//not //implemented
};
#endif

//file vtkARWindow.cxx
vtkARWindow::vtkARWindow(){
	this->ImageRenderer = vtkRenderer::New();
	this->VirtObjRenderer = vtkRenderer::New();
	this->SetNumberOfLayers(2);
	this->AddRenderer(ImageRenderer);
	this->AddRenderer(VirtObjRenderer);
	ImageRenderer->SetLayer(0);
	VirtObjRenderer->SetLayer(1);
	this->SetSize(WinXsize, WinYsize);
}

thanks in advance



More information about the vtkusers mailing list