[vtkusers] Inresolved external for QVTKWidget in VTK-8.0.1.
Zoltan Kovacs
Zoltan.Kovacs at esi-group.com
Tue Oct 10 10:10:18 EDT 2017
Dear all,
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
C:\VTK\8.0.1\include\vtk-8.0 and
C:\VTK\8.0.1\lib.
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 \
-lvtkRenderingLOD-8.0 \
-lvtkRenderingOpenGL2-8.0 \
-lvtkRenderingQt-8.0 \
-lvtkRenderingVolume-8.0 \
-lvtkRenderingVolumeOpenGL2-8.0 \
-lvtksqlite-8.0 \
-lvtksys-8.0 \
-lvtkTestingGenericBridge-8.0 \
-lvtkTestingIOSQL-8.0 \
-lvtkTestingRendering-8.0 \
-lvtktiff-8.0 \
-lvtkverdict-8.0 \
-lvtkViewsContext2D-8.0 \
-lvtkViewsCore-8.0 \
-lvtkViewsInfovis-8.0 \
-lvtkViewsQt-8.0 \
-lvtkzlib-8.0 \
-lvtkalglib-8.0 \
-lvtkChartsCore-8.0 \
-lvtkCommonColor-8.0 \
-lvtkCommonComputationalGeometry-8.0 \
-lvtkCommonCore-8.0 \
-lvtkCommonDataModel-8.0 \
-lvtkCommonExecutionModel-8.0 \
-lvtkCommonMath-8.0 \
-lvtkCommonMisc-8.0 \
-lvtkCommonSystem-8.0 \
-lvtkCommonTransforms-8.0 \
-lvtkDICOMParser-8.0 \
-lvtkDomainsChemistry-8.0 \
-lvtkDomainsChemistryOpenGL2-8.0 \
-lvtkexoIIc-8.0 \
-lvtkexpat-8.0 \
-lvtkFiltersAMR-8.0 \
-lvtkFiltersCore-8.0 \
-lvtkFiltersExtraction-8.0 \
-lvtkFiltersFlowPaths-8.0 \
-lvtkFiltersGeneral-8.0 \
-lvtkFiltersGeneric-8.0 \
-lvtkFiltersGeometry-8.0 \
-lvtkFiltersHybrid-8.0 \
-lvtkFiltersHyperTree-8.0 \
-lvtkFiltersImaging-8.0 \
-lvtkFiltersModeling-8.0 \
-lvtkFiltersParallel-8.0 \
-lvtkFiltersParallelImaging-8.0 \
-lvtkFiltersPoints-8.0 \
-lvtkFiltersProgrammable-8.0 \
-lvtkFiltersSelection-8.0 \
-lvtkFiltersSMP-8.0 \
-lvtkFiltersSources-8.0 \
-lvtkFiltersStatistics-8.0 \
-lvtkFiltersTexture-8.0 \
-lvtkFiltersTopology-8.0 \
-lvtkFiltersVerdict-8.0 \
-lvtkfreetype-8.0 \
-lvtkGeovisCore-8.0 \
-lvtkgl2ps-8.0 \
-lvtkglew-8.0 \
-lvtkGUISupportQt-8.0 \
-lvtkGUISupportQtSQL-8.0 \
-lvtkhdf5_hl-8.0 \
-lvtkhdf5-8.0 \
-lvtkImagingColor-8.0 \
-lvtkImagingCore-8.0 \
-lvtkImagingFourier-8.0 \
-lvtkImagingGeneral-8.0 \
-lvtkImagingHybrid-8.0 \
-lvtkImagingMath-8.0 \
-lvtkImagingMorphological-8.0 \
-lvtkImagingSources-8.0 \
-lvtkImagingStatistics-8.0 \
-lvtkImagingStencil-8.0 \
-lvtkInfovisCore-8.0 \
-lvtkInfovisLayout-8.0 \
-lvtkInteractionImage-8.0 \
-lvtkInteractionStyle-8.0 \
-lvtkInteractionWidgets-8.0 \
-lvtkIOAMR-8.0 \
-lvtkIOCore-8.0 \
-lvtkIOEnSight-8.0 \
-lvtkIOExodus-8.0 \
-lvtkIOExport-8.0 \
-lvtkIOExportOpenGL2-8.0 \
-lvtkIOGeometry-8.0 \
-lvtkIOImage-8.0 \
-lvtkIOImport-8.0 \
-lvtkIOInfovis-8.0 \
-lvtkIOLegacy-8.0 \
-lvtkIOLSDyna-8.0 \
-lvtkIOMINC-8.0 \
-lvtkIOMovie-8.0 \
-lvtkIONetCDF-8.0 \
-lvtkIOParallel-8.0 \
-lvtkIOParallelXML-8.0 \
-lvtkIOPLY-8.0 \
-lvtkIOSQL-8.0 \
-lvtkIOTecplotTable-8.0 \
-lvtkIOVideo-8.0 \
-lvtkIOXML-8.0 \
-lvtkIOXMLParser-8.0 \
-lvtkjpeg-8.0 \
-lvtkjsoncpp-8.0 \
-lvtklibharu-8.0 \
-lvtklibxml2-8.0 \
-lvtkLocalExample-8.0 \
-lvtklz4-8.0 \
-lvtkmetaio-8.0 \
-lvtknetcdf_c++ \
-lvtkNetCDF-8.0 \
-lvtkoggtheora-8.0 \
-lvtkParallelCore-8.0 \
-lvtkpng-8.0 \
-lvtkproj4-8.0 \
-lvtkRenderingAnnotation-8.0 \
-lvtkRenderingContext2D-8.0 \
-lvtkRenderingContextOpenGL2-8.0 \
-lvtkRenderingCore-8.0 \
-lvtkRenderingFreeType-8.0 \
-lvtkRenderingGL2PSOpenGL2-8.0 \
-lvtkRenderingImage-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.
Kind regars,
Zoltan
Regards,
Zoltan
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.
>
> Regards,
> Joni
>
> 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.
>>
>> Regards,
>> Zoltan
>>
>> 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.
>>>
>>> Regards,
>>> Joni
>>> --
>>> 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
mailing list