[vtkusers] Inresolved external for QVTKWidget in VTK-8.0.1.
Zoltan.Kovacs at esi-group.com
Tue Oct 10 10:10:18 EDT 2017
In CMake I generated a solution project of VTK-8.0.1 with Qt5 support
for MSVS2013. After having run the ALL_BUILD and INSTALL projects with
the install prefix C:\VTK\8.0.1 in VM2013 I could installed the Win32
bit binaries of VTK 8.0.1 in that folder. The header files and the
libraries are located in
I copied the file QVTKWidgetPlugin.dll from the VTK binary folders to
the plugin folder of QTCreator, which uses QT 5.8 msvs2013 32 bit version.
Then I set the include and library paths and added all the VTK libary
files from C:\VTK\8.0.1\lib for the linker setting in the project file
of a QT application in QtCreator:
INCLUDEPATH += C:\VTK\8.0.1\include\vtk-8.0
LIBS += -LC:\VTK\8.0.1\lib
LIBS += -lvtkRenderingLabel-8.0 \
However, if I add a QVTKWidget on the UI file of the application,
include the file QVTKWidget.h in the header file of the application and
I try to link it in QtCreator with the 32-bit VTK and Qt libraries,
MSVS2013 (in the toolchain of QtCreator) sends error messages for
unresolved external symbols for all the functions/classes belonging to
the QVTKWidget, such as
distortionpage.obj:-1: Fehler: LNK2019: unresolved external symbol
"__declspec(dllimport) public: __thiscall QVTKWidget::QVTKWidget(class
QWidget *,class QFlags<enum Qt::WindowType>)"
(__imp_??0QVTKWidget@@QAE at PAVQWidget@@V?$QFlags at W4WindowType@Qt@@@@@Z)
referenced in function "public: void __thiscall
Ui_DistortionPage::setupUi(class QWidget *)"
(?setupUi at Ui_DistortionPage@@QAEXPAVQWidget@@@Z)
It seems that the linker could not find the libary for the QVTKWidget
plugin, which is loaded since I could chose QtWidget from the widget
list in the UI form editor in QtCreator. I do not see any ABI issue here
since I use the 32 bit mscv2103 version of Qt and I also compiled and
linked the 32 bit version of VTK libaries and plugin files with
MSVS2013. I am wondering if anybody could make VTK-8.1 working with Qt.
Thanks a lot.
Am 09.10.2017 um 07:34 schrieb support at qt.io:
> Hi Zoltan,
> I don't know how the widget should be installed or set up in a project, but you could just search for the header file and point INCLUDEPATH to the folder that contains it.
> On 06 October 2017 at 18:26:00 EEST Zoltan.Kovacs at esi-group.com wrote:
>> Hi Joni,
>> I see. However I found MSCV2013 32 bit version for Qt 5.8. I install
>> that version and I built the VTK binaries for win32 platform with
>> MVS2013. After having copied the VTK plugin file into the plugin folder
>> of QtCreator I could launch it successfully. The QVTKWidget is in the
>> Widget list of QtCreator now. I could insert a QVTKWidget in the UI form
>> as well. The only problem now is that QtCreator cannot find the header
>> file for QVTKWidget. It is not cleat how to set the INCLUDEPATH in the
>> project file since VS2103 did not create a separate include folder in
>> the target folder C:/VTK/bin for the VTK binaries. Only the library
>> files have a separate folder, C:/VTK/bin/lib/Release.
>> Am 06.10.2017 um 12:08 schrieb support at qt.io:
>>> Hi Zoltan,
>>> On 06 October 2017 at 13:00:00 EEST Zoltan.Kovacs at esi-group.com wrote:
>>>> Hi Joni,
>>>> Thank you very much for your answer. Then I try to install everything
>>>> from scratch. The only prolem is I have only MSVC 2103 and the only
>>>> option in the selection list of the online installer for MSVC 2013 is
>>>> the 64 bit version. Is there somewhere an installer on your website wich
>>>> provides a relatively new Qt version with MSVC 2103 32 bit version?
>>>> Thank you very much for your help.
>>> No, but you could compile it from source yourself. However, note that you cannot build plugins for new Qt Creator with MSVC 2013 as it uses different ABI. You could use MSVC 2015 or MSVC 2017.
>>> Or you could build 64bit version of Qt Creator from source with that Qt version you have installed.
>>> Joni Poikelin
>>> Software Engineer,
>>> The Qt Company
>>> FAQs - https://wiki.qt.io/KnowledgeBase:SupportFAQ
> Joni Poikelin
> Software Engineer,
> The Qt Company
> FAQs - https://wiki.qt.io/KnowledgeBase:SupportFAQ
More information about the vtkusers