The code is as follows:
MainWindow: : MainWindow (QWidget * parent) :
QMainWindow (parent),
UI (new UI: : MainWindow)
{
The UI - & gt; SetupUi (this);
//mouse tracking
This - & gt; SetMouseTracking (true);
The UI - & gt; CentralWidget - & gt; SetMouseTracking (true);
CreateStatusBar ();
//initialize display controls for objects created by the open space
QvtkWidget=new qvtkWidget (this);
Viewer. Reset (new photo: : the visualization: : PCLVisualizer (" viewer ", false));
//the two sentences code is very important,
QvtkWidget - & gt; SetRenderWindow (viewer - & gt; GetRenderWindow ());
Viewer - & gt; SetupInteractor (qvtkWidget - & gt; GetInteractor (), qvtkWidget - & gt; GetRenderWindow ());
SetCentralWidget (qvtkWidget);
QvtkWidget - & gt; The update ();
}
Error:
Mainwindow. Obj: error LNK2019: cannot resolve the external symbol "__declspec (dllimport) public: __cdecl QVTKWidget: : QVTKWidget (class QWidget *, class QFlags
Mainwindow. Obj: error LNK2019: cannot resolve the external symbol "__declspec (dllimport) public: virtual __cdecl QVTKWidget: : ~ QVTKWidget (void)" (__imp_?? 1 QVTKWidget @ @ UEAA @ XZ), the symbol in the function "public: virtual void * __cdecl QVTKWidget: : ` scalar deleting destructor '(unsigned int)" (?????? _GQVTKWidget @ @ UEAAPEAXI @ Z) referenced
Mainwindow. Obj: error LNK2001: cannot resolve the external symbol of "public: virtual class QVTKInteractor * __cdecl QVTKWidget: : GetInteractor (void)" (? GetInteractor @ QVTKWidget @ @ UEAAPEAVQVTKInteractor @ @ XZ)
Mainwindow. Obj: error LNK2001: cannot resolve the external symbol of "public: virtual class vtkRenderWindow * __cdecl QVTKWidget: : GetRenderWindow (void)" (? GetRenderWindow @ QVTKWidget @ @ UEAAPEAVvtkRenderWindow @ @ XZ)
Mainwindow. Obj: error LNK2001: cannot resolve the external symbol of "public: virtual void __cdecl QVTKWidget: : SetRenderWindow (class vtkRenderWindow *)" (? SetRenderWindow @ QVTKWidget @ @ UEAAXPEAVvtkRenderWindow @ @ @ Z)
Mainwindow. Obj: error LNK2001: cannot resolve the external symbol of "public: virtual class vtkImageData * __cdecl QVTKWidget: : cachedImage (void)" (? CachedImage @ QVTKWidget @ @ UEAAPEAVvtkImageData @ @ XZ)
Mainwindow. Obj: error LNK2001: cannot resolve the external symbol of "protected: virtual void __cdecl QVTKWidget: : contextMenuEvent (class QContextMenuEvent *)" (? ContextMenuEvent @ QVTKWidget @ @ MEAAXPEAVQContextMenuEvent @ @ @ Z)
Mainwindow. Obj: error LNK2001: cannot resolve the external symbol of "protected: virtual void __cdecl QVTKWidget: : dragEnterEvent (class QDragEnterEvent *)" (? DragEnterEvent @ QVTKWidget @ @ MEAAXPEAVQDragEnterEvent @ @ @ Z)
Mainwindow. Obj: error LNK2001: cannot resolve the external symbol of "protected: virtual void __cdecl QVTKWidget: : dragLeaveEvent (class QDragLeaveEvent *)" (? DragLeaveEvent @ QVTKWidget @ @ MEAAXPEAVQDragLeaveEvent @ @ @ Z)
Mainwindow. Obj: error LNK2001: cannot resolve the external symbol of "protected: virtual void __cdecl QVTKWidget: : dragMoveEvent (class QDragMoveEvent *)" (? DragMoveEvent @ QVTKWidget @ @ MEAAXPEAVQDragMoveEvent @ @ @ Z)
Mainwindow. Obj: error LNK2001: cannot resolve the external symbol of "protected: virtual void __cdecl QVTKWidget: : dropEvent (class QDropEvent *)" (? DropEvent @ QVTKWidget @ @ MEAAXPEAVQDropEvent @ @ @ Z)
Mainwindow. Obj: error LNK2001: cannot resolve the external symbol of "protected: virtual void __cdecl QVTKWidget: : enterEvent (class QEvent *)" (? EnterEvent @ QVTKWidget @ @ MEAAXPEAVQEvent @ @ @ Z)
Mainwindow. Obj: error LNK2001: cannot resolve the external symbol of "protected: virtual bool __cdecl QVTKWidget: : event (class QEvent *)" (? The event @ QVTKWidget @ @ MEAA_NPEAVQEvent @ @ @ Z)
Mainwindow. Obj: error LNK2001: cannot resolve the external symbol of "protected: virtual void __cdecl QVTKWidget: : focusInEvent (class QFocusEvent *)" (? FocusInEvent @ QVTKWidget @ @ MEAAXPEAVQFocusEvent @ @ @ Z)
Mainwindow. Obj: error LNK2001: cannot resolve the external symbol of "protected: virtual void __cdecl QVTKWidget: : focusOutEvent (class QFocusEvent *)" (? FocusOutEvent @ QVTKWidget @ @ MEAAXPEAVQFocusEvent @ @ @ Z)
Mainwindow. Obj: error LNK2001: cannot resolve the external symbol of "public: virtual bool __cdecl QVTKWidget: : isAutomaticImageCacheEnabled (void) const" (? IsAutomaticImageCacheEnabled @ QVTKWidget @ @ UEBA_NXZ)
Mainwindow. Obj: error LNK2001: cannot resolve the external symbol of "protected: virtual void __cdecl QVTKWidget: : keyPressEvent (class QKeyEvent *)" (? KeyPressEvent @ QVTKWidget @ @ MEAAXPEAVQKeyEvent @ @ @ Z)
Mainwindow. Obj: error LNK2001: cannot resolve the external symbol of "protected: virtual void __cdecl QVTKWidget: : keyReleaseEvent (class QKeyEvent *)" (? KeyReleaseEvent @ QVTKWidget @ @ MEAAXPEAVQKeyEvent @ @ @ Z)
Mainwindow. Obj: error LNK2001: cannot resolve the external symbol of "protected: virtual void __cdecl QVTKWidget: : leaveEvent (class QEvent *)" (? LeaveEvent @ QVTKWidget @ @ MEAAXPEAVQEvent @ @ @ Z)
Mainwindow. Obj: error LNK2001: cannot resolve the external symbol of "public: virtual double __cdecl QVTKWidget: : maxRenderRateForImageCache (void) const" (? MaxRenderRateForImageCache @ QVTKWidget @ @ UEBANXZ)
Mainwindow. Obj: error LNK2001: cannot resolve the external symbol of "public: virtual struct QMetaObject const * __cdecl QVTKWidget: : metaObject (void)" const (? MetaObject @ QVTKWidget @ @ UEBAPEBUQMetaObject @ @ XZ)
Mainwindow. Obj: error LNK2001: cannot resolve the external symbol of "protected: virtual void __cdecl QVTKWidget: : mouseMoveEvent (class QMouseEvent *)" (? MouseMoveEvent @ QVTKWidget @ @ MEAAXPEAVQMouseEvent @ @ @ Z)
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull