Linker building VTK Qt issue using VS2017

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Linker building VTK Qt issue using VS2017

massinissa bandou
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@PEAVQWidget@@V?$QFlags@W4WindowType@Qt@@@@@Z)
referenced in function "public: void __cdecl
Ui_MainWindowClass::setupUi(class QMainWindow *)"
(?setupUi@Ui_MainWindowClass@@QEAAXPEAVQMainWindow@@@Z)
1>MainWindow.obj : error LNK2019: unresolved external symbol
"__declspec(dllimport) public: virtual __cdecl
QVTKWidget::~QVTKWidget(void)" (__imp_??1QVTKWidget@@UEAA@XZ) referenced in
function "public: virtual void * __cdecl QVTKWidget::`scalar deleting
destructor'(unsigned int)" (??_GQVTKWidget@@UEAAPEAXI@Z)
1>MainWindow.obj : error LNK2001: unresolved external symbol "public:
virtual class QVTKInteractor * __cdecl QVTKWidget::GetInteractor(void)"
(?GetInteractor@QVTKWidget@@UEAAPEAVQVTKInteractor@@XZ)
1>MainWindow.obj : error LNK2001: unresolved external symbol "public:
virtual class vtkRenderWindow * __cdecl QVTKWidget::GetRenderWindow(void)"
(?GetRenderWindow@QVTKWidget@@UEAAPEAVvtkRenderWindow@@XZ)
1>MainWindow.obj : error LNK2001: unresolved external symbol "public:
virtual void __cdecl QVTKWidget::SetRenderWindow(class vtkRenderWindow *)"
(?SetRenderWindow@QVTKWidget@@UEAAXPEAVvtkRenderWindow@@@Z)
1>MainWindow.obj : error LNK2001: unresolved external symbol "public:
virtual class vtkImageData * __cdecl QVTKWidget::cachedImage(void)"
(?cachedImage@QVTKWidget@@UEAAPEAVvtkImageData@@XZ)
1>MainWindow.obj : error LNK2001: unresolved external symbol "protected:
virtual void __cdecl QVTKWidget::contextMenuEvent(class QContextMenuEvent
*)" (?contextMenuEvent@QVTKWidget@@MEAAXPEAVQContextMenuEvent@@@Z)
1>MainWindow.obj : error LNK2001: unresolved external symbol "protected:
virtual void __cdecl QVTKWidget::dragEnterEvent(class QDragEnterEvent *)"
(?dragEnterEvent@QVTKWidget@@MEAAXPEAVQDragEnterEvent@@@Z)
1>MainWindow.obj : error LNK2001: unresolved external symbol "protected:
virtual void __cdecl QVTKWidget::dragLeaveEvent(class QDragLeaveEvent *)"
(?dragLeaveEvent@QVTKWidget@@MEAAXPEAVQDragLeaveEvent@@@Z)
1>MainWindow.obj : error LNK2001: unresolved external symbol "protected:
virtual void __cdecl QVTKWidget::dragMoveEvent(class QDragMoveEvent *)"
(?dragMoveEvent@QVTKWidget@@MEAAXPEAVQDragMoveEvent@@@Z)
1>MainWindow.obj : error LNK2001: unresolved external symbol "protected:
virtual void __cdecl QVTKWidget::dropEvent(class QDropEvent *)"
(?dropEvent@QVTKWidget@@MEAAXPEAVQDropEvent@@@Z)
1>MainWindow.obj : error LNK2001: unresolved external symbol "protected:
virtual void __cdecl QVTKWidget::enterEvent(class QEvent *)"
(?enterEvent@QVTKWidget@@MEAAXPEAVQEvent@@@Z)
1>MainWindow.obj : error LNK2001: unresolved external symbol "protected:
virtual bool __cdecl QVTKWidget::event(class QEvent *)"
(?event@QVTKWidget@@MEAA_NPEAVQEvent@@@Z)
1>MainWindow.obj : error LNK2001: unresolved external symbol "protected:
virtual void __cdecl QVTKWidget::focusInEvent(class QFocusEvent *)"
(?focusInEvent@QVTKWidget@@MEAAXPEAVQFocusEvent@@@Z)
1>MainWindow.obj : error LNK2001: unresolved external symbol "protected:
virtual void __cdecl QVTKWidget::focusOutEvent(class QFocusEvent *)"
(?focusOutEvent@QVTKWidget@@MEAAXPEAVQFocusEvent@@@Z)
1>MainWindow.obj : error LNK2001: unresolved external symbol "public:
virtual bool __cdecl QVTKWidget::isAutomaticImageCacheEnabled(void)const "
(?isAutomaticImageCacheEnabled@QVTKWidget@@UEBA_NXZ)
1>MainWindow.obj : error LNK2001: unresolved external symbol "protected:
virtual void __cdecl QVTKWidget::keyPressEvent(class QKeyEvent *)"
(?keyPressEvent@QVTKWidget@@MEAAXPEAVQKeyEvent@@@Z)
1>MainWindow.obj : error LNK2001: unresolved external symbol "protected:
virtual void __cdecl QVTKWidget::keyReleaseEvent(class QKeyEvent *)"
(?keyReleaseEvent@QVTKWidget@@MEAAXPEAVQKeyEvent@@@Z)
1>MainWindow.obj : error LNK2001: unresolved external symbol "protected:
virtual void __cdecl QVTKWidget::leaveEvent(class QEvent *)"
(?leaveEvent@QVTKWidget@@MEAAXPEAVQEvent@@@Z)
1>MainWindow.obj : error LNK2001: unresolved external symbol "public:
virtual double __cdecl QVTKWidget::maxRenderRateForImageCache(void)const "
(?maxRenderRateForImageCache@QVTKWidget@@UEBANXZ)
1>MainWindow.obj : error LNK2001: unresolved external symbol "public:
virtual struct QMetaObject const * __cdecl QVTKWidget::metaObject(void)const
" (?metaObject@QVTKWidget@@UEBAPEBUQMetaObject@@XZ)
1>MainWindow.obj : error LNK2001: unresolved external symbol "protected:
virtual void __cdecl QVTKWidget::mouseMoveEvent(class QMouseEvent *)"
(?mouseMoveEvent@QVTKWidget@@MEAAXPEAVQMouseEvent@@@Z)
1>MainWindow.obj : error LNK2001: unresolved external symbol "protected:
virtual void __cdecl QVTKWidget::mousePressEvent(class QMouseEvent *)"
(?mousePressEvent@QVTKWidget@@MEAAXPEAVQMouseEvent@@@Z)
1>MainWindow.obj : error LNK2001: unresolved external symbol "protected:
virtual void __cdecl QVTKWidget::mouseReleaseEvent(class QMouseEvent *)"
(?mouseReleaseEvent@QVTKWidget@@MEAAXPEAVQMouseEvent@@@Z)
1>MainWindow.obj : error LNK2001: unresolved external symbol "protected:
virtual void __cdecl QVTKWidget::moveEvent(class QMoveEvent *)"
(?moveEvent@QVTKWidget@@MEAAXPEAVQMoveEvent@@@Z)
1>MainWindow.obj : error LNK2001: unresolved external symbol "protected:
virtual bool __cdecl QVTKWidget::nativeEvent(class QByteArray const &,void
*,long *)" (?nativeEvent@QVTKWidget@@MEAA_NAEBVQByteArray@@PEAXPEAJ@Z)
1>MainWindow.obj : error LNK2001: unresolved external symbol "protected:
virtual bool __cdecl QVTKWidget::paintCachedImage(void)"
(?paintCachedImage@QVTKWidget@@MEAA_NXZ)
1>MainWindow.obj : error LNK2001: unresolved external symbol "public:
virtual class QPaintEngine * __cdecl QVTKWidget::paintEngine(void)const "
(?paintEngine@QVTKWidget@@UEBAPEAVQPaintEngine@@XZ)
1>MainWindow.obj : error LNK2001: unresolved external symbol "protected:
virtual void __cdecl QVTKWidget::paintEvent(class QPaintEvent *)"
(?paintEvent@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@QVTKWidget@@UEAAHW4Call@QMetaObject@@HPEAPEAX@Z)
1>MainWindow.obj : error LNK2001: unresolved external symbol "public:
virtual void * __cdecl QVTKWidget::qt_metacast(char const *)"
(?qt_metacast@QVTKWidget@@UEAAPEAXPEBD@Z)
1>MainWindow.obj : error LNK2001: unresolved external symbol "protected:
virtual void __cdecl QVTKWidget::resizeEvent(class QResizeEvent *)"
(?resizeEvent@QVTKWidget@@MEAAXPEAVQResizeEvent@@@Z)
1>MainWindow.obj : error LNK2001: unresolved external symbol "public:
virtual void __cdecl QVTKWidget::setAutomaticImageCacheEnabled(bool)"
(?setAutomaticImageCacheEnabled@QVTKWidget@@UEAAX_N@Z)
1>MainWindow.obj : error LNK2001: unresolved external symbol "public:
virtual void __cdecl QVTKWidget::setMaxRenderRateForImageCache(double)"
(?setMaxRenderRateForImageCache@QVTKWidget@@UEAAXN@Z)
1>MainWindow.obj : error LNK2001: unresolved external symbol "public:
virtual void __cdecl QVTKWidget::showEvent(class QShowEvent *)"
(?showEvent@QVTKWidget@@UEAAXPEAVQShowEvent@@@Z)
1>MainWindow.obj : error LNK2001: unresolved external symbol "protected:
virtual void __cdecl QVTKWidget::wheelEvent(class QWheelEvent *)"
(?wheelEvent@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
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtkusers
Software Design Engineer
Reply | Threaded
Open this post in threaded view
|

Re: Linker building VTK Qt issue using VS2017

massinissa bandou
Here is my CMakelis CMakeLists.txt
<http://vtk.1045678.n5.nabble.com/file/t342667/CMakeLists.txt>  t.txt



-----
Software Design Engineer
--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtkusers
Software Design Engineer
Reply | Threaded
Open this post in threaded view
|

Re: Linker building VTK Qt issue using VS2017

VTK - Users mailing list
Hi, you may want to post on https://discourse.vtk.org. That's where community support is moving for VTK.

Cory

On Sun, Mar 3, 2019 at 3:26 PM massinissa bandou <[hidden email]> wrote:
Here is my CMakelis CMakeLists.txt
<http://vtk.1045678.n5.nabble.com/file/t342667/CMakeLists.txt>  t.txt



-----
Software Design Engineer
--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtkusers


--
Cory Quammen
Staff R&D Engineer
Kitware, Inc.

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtkusers