[vtkusers] Linker building VTK Qt issue using VS2017
massinissa bandou
massinissa.bandou at gmail.com
Sun Mar 3 14:00:19 EST 2019
Good day VTK users,
I'm trying to use VTK within a QT application on VS2017. I managed to build
VTK6.3 and Qt on VS 64x but when I drag and drop QVTKWidget on my ui and
build, I get the following:
1>MainWindow.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) public: __cdecl QVTKWidget::QVTKWidget(class QWidget
*,class QFlags<enum Qt::WindowType>)"
(__imp_??0QVTKWidget@@QEAA at PEAVQWidget@@V?$QFlags at W4WindowType@Qt@@@@@Z)
referenced in function "public: void __cdecl
Ui_MainWindowClass::setupUi(class QMainWindow *)"
(?setupUi at Ui_MainWindowClass@@QEAAXPEAVQMainWindow@@@Z)
1>MainWindow.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) public: virtual __cdecl
QVTKWidget::~QVTKWidget(void)" (__imp_??1QVTKWidget@@UEAA at XZ) referenced in
function "public: virtual void * __cdecl QVTKWidget::`scalar deleting
destructor'(unsigned int)" (??_GQVTKWidget@@UEAAPEAXI at Z)
1>MainWindow.obj : error LNK2001: unresolved external symbol "public:
virtual class QVTKInteractor * __cdecl QVTKWidget::GetInteractor(void)"
(?GetInteractor at QVTKWidget@@UEAAPEAVQVTKInteractor@@XZ)
1>MainWindow.obj : error LNK2001: unresolved external symbol "public:
virtual class vtkRenderWindow * __cdecl QVTKWidget::GetRenderWindow(void)"
(?GetRenderWindow at QVTKWidget@@UEAAPEAVvtkRenderWindow@@XZ)
1>MainWindow.obj : error LNK2001: unresolved external symbol "public:
virtual void __cdecl QVTKWidget::SetRenderWindow(class vtkRenderWindow *)"
(?SetRenderWindow at QVTKWidget@@UEAAXPEAVvtkRenderWindow@@@Z)
1>MainWindow.obj : error LNK2001: unresolved external symbol "public:
virtual class vtkImageData * __cdecl QVTKWidget::cachedImage(void)"
(?cachedImage at QVTKWidget@@UEAAPEAVvtkImageData@@XZ)
1>MainWindow.obj : error LNK2001: unresolved external symbol "protected:
virtual void __cdecl QVTKWidget::contextMenuEvent(class QContextMenuEvent
*)" (?contextMenuEvent at QVTKWidget@@MEAAXPEAVQContextMenuEvent@@@Z)
1>MainWindow.obj : error LNK2001: unresolved external symbol "protected:
virtual void __cdecl QVTKWidget::dragEnterEvent(class QDragEnterEvent *)"
(?dragEnterEvent at QVTKWidget@@MEAAXPEAVQDragEnterEvent@@@Z)
1>MainWindow.obj : error LNK2001: unresolved external symbol "protected:
virtual void __cdecl QVTKWidget::dragLeaveEvent(class QDragLeaveEvent *)"
(?dragLeaveEvent at QVTKWidget@@MEAAXPEAVQDragLeaveEvent@@@Z)
1>MainWindow.obj : error LNK2001: unresolved external symbol "protected:
virtual void __cdecl QVTKWidget::dragMoveEvent(class QDragMoveEvent *)"
(?dragMoveEvent at QVTKWidget@@MEAAXPEAVQDragMoveEvent@@@Z)
1>MainWindow.obj : error LNK2001: unresolved external symbol "protected:
virtual void __cdecl QVTKWidget::dropEvent(class QDropEvent *)"
(?dropEvent at QVTKWidget@@MEAAXPEAVQDropEvent@@@Z)
1>MainWindow.obj : error LNK2001: unresolved external symbol "protected:
virtual void __cdecl QVTKWidget::enterEvent(class QEvent *)"
(?enterEvent at QVTKWidget@@MEAAXPEAVQEvent@@@Z)
1>MainWindow.obj : error LNK2001: unresolved external symbol "protected:
virtual bool __cdecl QVTKWidget::event(class QEvent *)"
(?event at QVTKWidget@@MEAA_NPEAVQEvent@@@Z)
1>MainWindow.obj : error LNK2001: unresolved external symbol "protected:
virtual void __cdecl QVTKWidget::focusInEvent(class QFocusEvent *)"
(?focusInEvent at QVTKWidget@@MEAAXPEAVQFocusEvent@@@Z)
1>MainWindow.obj : error LNK2001: unresolved external symbol "protected:
virtual void __cdecl QVTKWidget::focusOutEvent(class QFocusEvent *)"
(?focusOutEvent at QVTKWidget@@MEAAXPEAVQFocusEvent@@@Z)
1>MainWindow.obj : error LNK2001: unresolved external symbol "public:
virtual bool __cdecl QVTKWidget::isAutomaticImageCacheEnabled(void)const "
(?isAutomaticImageCacheEnabled at QVTKWidget@@UEBA_NXZ)
1>MainWindow.obj : error LNK2001: unresolved external symbol "protected:
virtual void __cdecl QVTKWidget::keyPressEvent(class QKeyEvent *)"
(?keyPressEvent at QVTKWidget@@MEAAXPEAVQKeyEvent@@@Z)
1>MainWindow.obj : error LNK2001: unresolved external symbol "protected:
virtual void __cdecl QVTKWidget::keyReleaseEvent(class QKeyEvent *)"
(?keyReleaseEvent at QVTKWidget@@MEAAXPEAVQKeyEvent@@@Z)
1>MainWindow.obj : error LNK2001: unresolved external symbol "protected:
virtual void __cdecl QVTKWidget::leaveEvent(class QEvent *)"
(?leaveEvent at QVTKWidget@@MEAAXPEAVQEvent@@@Z)
1>MainWindow.obj : error LNK2001: unresolved external symbol "public:
virtual double __cdecl QVTKWidget::maxRenderRateForImageCache(void)const "
(?maxRenderRateForImageCache at QVTKWidget@@UEBANXZ)
1>MainWindow.obj : error LNK2001: unresolved external symbol "public:
virtual struct QMetaObject const * __cdecl QVTKWidget::metaObject(void)const
" (?metaObject at QVTKWidget@@UEBAPEBUQMetaObject@@XZ)
1>MainWindow.obj : error LNK2001: unresolved external symbol "protected:
virtual void __cdecl QVTKWidget::mouseMoveEvent(class QMouseEvent *)"
(?mouseMoveEvent at QVTKWidget@@MEAAXPEAVQMouseEvent@@@Z)
1>MainWindow.obj : error LNK2001: unresolved external symbol "protected:
virtual void __cdecl QVTKWidget::mousePressEvent(class QMouseEvent *)"
(?mousePressEvent at QVTKWidget@@MEAAXPEAVQMouseEvent@@@Z)
1>MainWindow.obj : error LNK2001: unresolved external symbol "protected:
virtual void __cdecl QVTKWidget::mouseReleaseEvent(class QMouseEvent *)"
(?mouseReleaseEvent at QVTKWidget@@MEAAXPEAVQMouseEvent@@@Z)
1>MainWindow.obj : error LNK2001: unresolved external symbol "protected:
virtual void __cdecl QVTKWidget::moveEvent(class QMoveEvent *)"
(?moveEvent at QVTKWidget@@MEAAXPEAVQMoveEvent@@@Z)
1>MainWindow.obj : error LNK2001: unresolved external symbol "protected:
virtual bool __cdecl QVTKWidget::nativeEvent(class QByteArray const &,void
*,long *)" (?nativeEvent at QVTKWidget@@MEAA_NAEBVQByteArray@@PEAXPEAJ at Z)
1>MainWindow.obj : error LNK2001: unresolved external symbol "protected:
virtual bool __cdecl QVTKWidget::paintCachedImage(void)"
(?paintCachedImage at QVTKWidget@@MEAA_NXZ)
1>MainWindow.obj : error LNK2001: unresolved external symbol "public:
virtual class QPaintEngine * __cdecl QVTKWidget::paintEngine(void)const "
(?paintEngine at QVTKWidget@@UEBAPEAVQPaintEngine@@XZ)
1>MainWindow.obj : error LNK2001: unresolved external symbol "protected:
virtual void __cdecl QVTKWidget::paintEvent(class QPaintEvent *)"
(?paintEvent at QVTKWidget@@MEAAXPEAVQPaintEvent@@@Z)
1>MainWindow.obj : error LNK2001: unresolved external symbol "public:
virtual int __cdecl QVTKWidget::qt_metacall(enum QMetaObject::Call,int,void
* *)" (?qt_metacall at QVTKWidget@@UEAAHW4Call at QMetaObject@@HPEAPEAX at Z)
1>MainWindow.obj : error LNK2001: unresolved external symbol "public:
virtual void * __cdecl QVTKWidget::qt_metacast(char const *)"
(?qt_metacast at QVTKWidget@@UEAAPEAXPEBD at Z)
1>MainWindow.obj : error LNK2001: unresolved external symbol "protected:
virtual void __cdecl QVTKWidget::resizeEvent(class QResizeEvent *)"
(?resizeEvent at QVTKWidget@@MEAAXPEAVQResizeEvent@@@Z)
1>MainWindow.obj : error LNK2001: unresolved external symbol "public:
virtual void __cdecl QVTKWidget::setAutomaticImageCacheEnabled(bool)"
(?setAutomaticImageCacheEnabled at QVTKWidget@@UEAAX_N at Z)
1>MainWindow.obj : error LNK2001: unresolved external symbol "public:
virtual void __cdecl QVTKWidget::setMaxRenderRateForImageCache(double)"
(?setMaxRenderRateForImageCache at QVTKWidget@@UEAAXN at Z)
1>MainWindow.obj : error LNK2001: unresolved external symbol "public:
virtual void __cdecl QVTKWidget::showEvent(class QShowEvent *)"
(?showEvent at QVTKWidget@@UEAAXPEAVQShowEvent@@@Z)
1>MainWindow.obj : error LNK2001: unresolved external symbol "protected:
virtual void __cdecl QVTKWidget::wheelEvent(class QWheelEvent *)"
(?wheelEvent at QVTKWidget@@MEAAXPEAVQWheelEvent@@@Z)
1>C:\Users\massi\OneDrive\Desktop\ImgAnalyzer\ImageAnalyzer\x64\Release\\ImageAnalyzer.exe
: fatal error LNK1120: 36 unresolved externals
1>Done building project "ImageAnalyzer.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I think I have linked properly the libraries and header files to my project.
Can you help me how to fix that?
Thanks!
Massi
-----
Software Design Engineer
--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
More information about the vtkusers
mailing list