Qt LNK2019: unresolved external symbol "__declspec(dllimport)..." VTK
-
Hello!
I am new with Qt and VTK.
I think I installed everything correctly (VTK in Release mode).I am trying to run the example in VTK/Examples/Cxx/Qt/BorderWidgetQt. I use CMake, then I open the solution in VS2010 and it builds perfectly (release mode).
BUT, when I try to build the exact same project in Qt Creator I have this errors:
borderwidgetqt.obj:-1: error: LNK2019: unresolved external symbol "__declspec(dllimport) public: static class vtkBorderWidget * __cdecl vtkBorderWidget::New(void)" (_imp?New@vtkBorderWidget@@SAPEAV1@XZ) referenced in function "public: static class vtkSmartPointer<class vtkBorderWidget> __cdecl vtkSmartPointer<class vtkBorderWidget>::New(void)" (?New@?$vtkSmartPointer@VvtkBorderWidget@@@@SA?AV1@XZ)
borderwidgetqt.obj:-1: error: LNK2019: unresolved external symbol "__declspec(dllimport) public: class vtkAlgorithmOutput * __cdecl vtkAlgorithm::GetOutputPort(int)" (_imp?GetOutputPort@vtkAlgorithm@@QEAAPEAVvtkAlgorithmOutput@@H@Z) referenced in function "public: __cdecl BorderWidgetQt::BorderWidgetQt(void)" (??0BorderWidgetQt@@QEAA@XZ)
borderwidgetqt.obj:-1: error: LNK2019: unresolved external symbol "__declspec(dllimport) public: static class vtkSphereSource * __cdecl vtkSphereSource::New(void)" (_imp?New@vtkSphereSource@@SAPEAV1@XZ) referenced in function "public: static class vtkSmartPointer<class vtkSphereSource> __cdecl vtkSmartPointer<class vtkSphereSource>::New(void)" (?New@?$vtkSmartPointer@VvtkSphereSource@@@@SA?AV1@XZ)
It seems that Qt is having problems in finding the dll?
My .pro file is:
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = BorderWidgetQt
TEMPLATE = app
SOURCES += main.cpp
borderwidgetqt.cpp
HEADERS += borderwidgetqt.h
FORMS += borderwidgetqt.ui
INCLUDEPATH += C:\VTK-7\install\include\vtk-7.0
LIBS += -L"C:\VTK-7\install\lib"
-lvtkRenderingCore-7.0
-lvtkChartsCore-7.0
-lvtkCommonCore-7.0
-lvtkFiltersCore-7.0
-lvtkGUISupportQt-7.0
-lvtkImagingCore-7.0
-lvtkInfovisCore-7.0
-lvtkIOCore-7.0
-lvtkViewsCore-7.0How can I fix this?
Please, I am stuck in here and I can't find any solution for that... I already tried build the project in Qt both in release and debug mode but the errors are the same...
Thank you in advance!!
-
Hi and welcome to devnet,
Are you trying to build this example ?
-
I missed something the first time I read your thread. Visual Studio 2010 ? Did you build VTK yourself with that version of VS ?
-
-
I might be insisting but do you have everything build with the same version of MSVC ? Same architecture ?
-
Wouldn't you be missing the
vtkWidgets
library in your .pro file ? -
@SGaist said in Qt LNK2019: unresolved external symbol "__declspec(dllimport)..." VTK:
You can mix
You can't mix :-)