[vtkusers] More QT and VTK Problems

Michael Rice marice at knology.net
Tue Aug 22 09:30:06 EDT 2006


Yes, this is the proper way to do it. Changes made to the qmake.conf  
file are automatically picked up by qmake.

I haven't used mingw, so I'm not sure how the LIBS setting should be.  
The example I gave is for using the MS linker. For more *nix type  
environments, the LIBS line should look more like:

LIBS += -L$$VTKLIBDIR \
         -lQVTK -lvtkHybrid -lvtkIO ...

Michael

On Aug 22, 2006, at 5:48 AM, Richard Haney wrote:

> Thank you. I will give this a try.
>
> Is adding these library/include paths manually to a .pro file the  
> only way? What if you changed some settings in the C:\Qt\4.1.4 
> \mkspecs\win32-g++\qmake.conf file? Would qmake automatically read  
> the new settings?
>
>
>> From: Michael Rice <marice at knology.net>
>> To: Richard Haney <cosmoh2o at hotmail.com>
>> CC: vtkusers at vtk.org
>> Subject: Re: [vtkusers] More QT and VTK Problems
>> Date: Mon, 21 Aug 2006 21:32:31 -0500
>>
>> You need to add the paths to the VTK includes and libraries paths  
>> to  the .pro file. You also need to add the VTK libraries to link to.
>>
>> For example (adjust as appropriate):
>>
>> TEMPLATE = app
>> VTKDIR = C:/VTK
>> VTKLIBDIR = $$VTKDIR/bin
>> DEPENDPATH += .
>> INCLUDEPATH += . \
>>                $$VTKDIR/Common \
>>                $$VTKDIR/Filtering \
>>                $$VTKDIR/GUISupport/Qt \
>>                $$VTKDIR/GenericFiltering \
>>                $$VTKDIR/Graphics \
>>                $$VTKDIR/Hybrid \
>>                $$VTKDIR/IO \
>>                $$VTKDIR/Imaging \
>>                $$VTKDIR/Rendering \
>>                $$VTKDIR/Utilities \
>>                $$VTKDIR/Widgets
>> LIBS += $$VTKLIBDIR/QVTK.lib \
>>         $$VTKLIBDIR/vtkHybrid.lib \
>>         $$VTKLIBDIR/vtkIO.lib \
>>         $$VTKLIBDIR/vtkImaging.lib \
>>         $$VTKLIBDIR/vtkRendering.lib \
>>         $$VTKLIBDIR/vtkWidgets.lib \
>>         $$VTKLIBDIR/vtkGraphics.lib \
>>         $$VTKLIBDIR/vtkFiltering.lib \
>>         $$VTKLIBDIR/vtkGenericFiltering.lib \
>>         $$VTKLIBDIR/vtkCommon.lib \
>>         $$VTKLIBDIR/vtkexoIIc.lib \
>>         $$VTKLIBDIR/vtkexpat.lib \
>>         $$VTKLIBDIR/vtkftgl.lib \
>>         $$VTKLIBDIR/vtkjpeg.lib \
>>         $$VTKLIBDIR/vtkpng.lib \
>>         $$VTKLIBDIR/vtktiff.lib \
>>         $$VTKLIBDIR/vtksys.lib \
>>         $$VTKLIBDIR/vtkzlib.lib \
>>         $$VTKLIBDIR/vtkfreetype.lib
>>
>> # Input
>> FORMS += designer.ui
>> SOURCES += main.cpp
>>
>>
>>
>> On Aug 21, 2006, at 7:22 PM, Richard Haney wrote:
>>
>>> Please Help,
>>>
>>> I have moved the libQVTKWidgetPlugin.dll to the Qt_Designer/ 
>>> plugins  directory (Qt version 4.1.4) and built a quick .ui file  
>>> based on  the dialog form, called myFile.ui with only a single  
>>> QVTK window  (pulled from the plugin).  I saved a main.cpp file  
>>> with it in the  same directory that looks like the following:
>>>
>>> #include "ui_myFile.h"
>>> #include <QApplication>
>>>
>>> int main(int argc, char *argv[]) {
>>>  QApplication app(argc, argv);
>>>  QDialog *window = new QDialog;
>>>  Ui::Dialog ui;
>>>  ui.setupUi(window);
>>>  window->show();
>>>  return app.exec();
>>> }
>>>
>>> The .pro file looks like the following:
>>> TEMPLATE = app
>>> TARGET +=
>>> DEPENDPATH += .
>>> INCLUDEPATH += .
>>>
>>> # Input
>>> FORMS += designer.ui
>>> SOURCES += main.cpp
>>>
>>> When I run "qmake", the MakeFile is created with no errors,  
>>> however  when I run "make" I get the following errors:
>>>
>>> C:\Qt\4.1.4\myProject\proj2>make
>>> mingw32-make -f Makefile.Debug all
>>> mingw32-make[1]: Entering directory `C:/Qt/4.1.4/myProject/proj2'
>>> g++ -c -g -g -frtti -fexceptions -Wall -DUNICODE -  
>>> DQT_LARGEFILE_SUPPORT -DQT_DLL
>>> -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -  
>>> I"C:/Qt/4.1.4/
>>> include/QtCore" -I"C:/Qt/4.1.4/include/QtGui" -I"C:/Qt/4.1.4/  
>>> include" -I"." -I"C
>>> :/Qt/4.1.4/include/ActiveQt" -I"tmp\moc\debug_shared" -I"." -I".. 
>>> \.. \mkspecs\win
>>> 32-g++" -o tmp\obj\debug_shared\main.o main.cpp
>>> In file included from main.cpp:1:
>>> ui_designer.h:4:24: QVTKWidget.h: No such file or directory
>>> In file included from main.cpp:1:
>>> ui_designer.h:23: error: ISO C++ forbids declaration of   
>>> `QVTKWidget' with no typ
>>> e
>>> ui_designer.h:23: error: expected `;' before '*' token
>>> ui_designer.h: In member function `void Ui_Dialog::setupUi 
>>> (QDialog*)':
>>> ui_designer.h:50: error: `qvtkWidget' undeclared (first use this   
>>> function)
>>> ui_designer.h:50: error: (Each undeclared identifier is reported   
>>> only once for e
>>> ach function it appears in.)
>>> ui_designer.h:50: error: `QVTKWidget' has not been declared
>>> mingw32-make[1]: *** [tmp\obj\debug_shared\main.o] Error 1
>>> mingw32-make[1]: Leaving directory `C:/Qt/4.1.4/myProject/proj2'
>>> mingw32-make: *** [debug-all] Error 2
>>>
>>> I am very new to QT-VTK and would appreciate any help.  I used   
>>> Qt4.1.4 and VTK-5.0.1 and used the latest version of Cmake  
>>> (2.4.3)  to build the VTK with "GUISUPPORT" so that the QT plugin  
>>> would be  built.
>>>
>>> Thanks in advance for ANY help/hints.
>>>
>>>
>>> _______________________________________________
>>> This is the private VTK discussion list. Please keep messages on-  
>>> topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.vtk.org/mailman/listinfo/vtkusers
>>>
>>
>
>
>




More information about the vtkusers mailing list