[vtkusers] QVTKWidget linking problem

Jim jiksed at yahoo.com
Wed Mar 11 18:26:39 EDT 2009


 
I solved this problem by myself by adding QVTK.lib to Linker | Input | Additional Dependencies. However, there are two new problems:
 
1) From Release Build, QVTKWidget won't refresh, i.e., it captures some random screen image and stays unchaged. Three Qt-VTK examples (release build) run without any issues.
2) Debug Build won't run (nothing pops up on the screen). This same problem happened to three Qt-VTK examples.
 
I am sure I have right PATH and VC++ Directories (Include files and library files) for both VKT and Qt. What am I missing here?
 
Thank you.


--- On Wed, 3/11/09, Jim <jiksed at yahoo.com> wrote:

From: Jim <jiksed at yahoo.com>
Subject: [vtkusers] QVTKWidget linking problem
To: "VTK" <vtkusers at vtk.org>
Date: Wednesday, March 11, 2009, 3:08 PM







Dear vtkusers, 
  
Thank you all for your help. I built VTK 5.2.1 in VS2008 Pro and all examples, including three Qt examples, run successfully. I added QVTKWidget plugin to Qt Toolbox in VS2008. One thing I learned is that you can't add QVTKWidget plugin to Qt Toolbox if you build VTK with Qt 4.5.0. VS Integration 1.4.3 does not recognize any widget plugin built with Qt 4.5.0 which is newer than VS Integ 1.4.3. 
  
Now I am building a "Hello World" example in VS 2008 with Qt integration. Here is my system configuration: 
  
1) New Project --> Qt Projects --> Qt Application 
2) Project Name: AddressBook, then click Finish button 
3) Build F7. Everything went OK and I saw a blank main window on the screen. 
4) Drag and drop a QVTKWidget on QMainWindow 
5) F5 or F7 
6) I got the following 35 error message. 
  
I tried including all kinds of QVTKWidget stuffs to my project but all failed. What is wrong? 
  
Thank you. 
Jim 
  
----------------------------  
1>------ Build started: Project: AddressBook, Configuration: Debug Win32 ------ 
1>Compiling... 
1>addressbook.cpp 
1>main.cpp 
1>Generating Code... 
1>Compiling... 
1>moc_addressbook.cpp 
1>Linking... 
1>addressbook.obj : error 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_AddressBookClass::setupUi(class QMainWindow *)" (?setupUi at Ui_AddressBookClass@@QAEXPAVQMainWindow@@@Z) 
1>addressbook.obj : error LNK2001: unresolved external symbol "public: virtual struct QMetaObject const * __thiscall QVTKWidget::metaObject(void)const " (?metaObject at QVTKWidget@@UBEPBUQMetaObject@@XZ) 
1>addressbook.obj : error LNK2001: unresolved external symbol "public: virtual void * __thiscall QVTKWidget::qt_metacast(char const *)" (?qt_metacast at QVTKWidget@@UAEPAXPBD at Z) 
1>addressbook.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall QVTKWidget::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall at QVTKWidget@@UAEHW4Call at QMetaObject@@HPAPAX at Z) 
1>addressbook.obj : error LNK2001: unresolved external symbol "protected: virtual bool __thiscall QVTKWidget::event(class QEvent *)" (?event at QVTKWidget@@MAE_NPAVQEvent@@@Z) 
1>addressbook.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall QVTKWidget::mousePressEvent(class QMouseEvent *)" (?mousePressEvent at QVTKWidget@@MAEXPAVQMouseEvent@@@Z) 
....... 
....... 
1>addressbook.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall QVTKWidget::~QVTKWidget(void)" (__imp_??1QVTKWidget@@UAE at XZ) referenced in function "public: virtual void * __thiscall QVTKWidget::`scalar deleting destructor'(unsigned int)" (??_GQVTKWidget@@UAEPAXI at Z) 
1>C:\Documents and Settings\tiger\My Documents\Visual Studio 2008\Projects\AddressBook\Debug\AddressBook.exe : fatal error LNK1120: 34 unresolved externals 
1>Build log was saved at "file://c:\Documents and Settings\tiger\My Documents\Visual Studio 2008\Projects\AddressBook\AddressBook\Debug\BuildLog.htm" 
1>AddressBook - 35 error(s), 0 warning(s) 
 
_______________________________________________
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

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



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090311/56bb9ecb/attachment.htm>


More information about the vtkusers mailing list