[vtkusers] QT,Eclipse,VTK and c++

Shakes Shekhar.Chandra at sci.monash.edu.au
Sun Dec 2 21:06:58 EST 2007


Hi Jose,

U should use the line:

LIBS += -LC:\vtk5.0-32b\lib\vtk-5.0

instead of LIBS += C:\vtk5.0-32b\lib\vtk-5.0 and then link the libraries 
as -lvtkRendering (with the -l in front). So u get

LIBS += -LC:\vtk5.0-32b\lib\vtk-5.0 -lvtkRendering

These are the standard gcc link instructions that u directly put into Qt 
projects. U could alternatively put the libraries into the mingw lib 
directory. Google for more info on how to link using gcc. Note u may 
need to link more vtk libraries than just Rendering. Hope that helps.

Cheers
Shakes

PS: This is my project linkage (edited)
unix:INCLUDEPATH += /usr/include/vtk-5.0 /usr/local/include/vtk-5.0
unix:LIBS += -L/usr/local/lib
unix:LIBS += -lvtkRendering -lvtkFiltering -lvtkGraphics 
-lvtkVolumeRendering -lvtkHybrid -lvtkImaging -lvtkIO -lvtkCommon

win32-msvc2005:LIBS += vtkRendering.lib vtkFiltering.lib vtkGraphics.lib 
vtkVolumeRendering.lib vtkHybrid.lib vtkImaging.lib vtkIO.lib vtkCommon.lib
win32-g++:LIBS += -lvtkRendering -lvtkFiltering -lvtkHybrid 
-lvtkGraphics -lvtkVolumeRendering -lvtkImaging -lvtkIO -lvtkCommon


Jose David Pfuturi Huisa wrote:
>  Hello all. I use Eclipse ,c++ and QT under WindowXP. I have installed 
> Eclipse, mingw32 with QT4 successfully but  i can only run c++ code, i 
> want to add vtk code therefore i changed the file *.pro as follows:
>
> TEMPLATE = app
>
> TARGET = QTvtkConsole
>
> QT += core \
>
> gui \
>
> opengl
>
> HEADERS +=
>
> SOURCES += Cone.cc
>
> FORMS +=
>
> RESOURCES +=
>
> INCLUDEPATH += C:/vtk5.0-32b/include/vtk-5.0
>
> LIBS += C:\vtk5.0-32b\lib\vtk-5.0
> but i got this result:
>  
>
> mingw32-make debug
>
> mingw32-make -f Makefile.Debug
>
> mingw32-make[1]: Entering directory 
> `F:/MisProyectosEclipse3.2/QTvtkConsole'
>
> g++ -mthreads -Wl,-enable-stdcall-fixup -Wl,-enable-auto-import 
> -Wl,-enable-runtime-pseudo-reloc -Wl,-subsystem,windows -o 
> "debug\QTvtkConsole.exe" debug\Cone.o -L"c:\Qt\4.1.4\lib" -lopengl32 
> -lglu32 -lgdi32 -luser32 -lmingw32 -lqtmaind C:\vtk5.0-32b\lib\vtk-5.0 
> -lQtOpenGLd4 -lQtGuid4 -lQtCored4
>
> C:\MinGW\bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\mingw32\bin\ld.exe: 
> C:\vtk5.0-32b\lib\vtk-5.0: No such file: Permission denied
>
> collect2: ld returned 1 exit status
>
> mingw32-make[1]: *** [debug\QTvtkConsole.exe] Error 1
>
> mingw32-make[1]: Leaving directory 
> `F:/MisProyectosEclipse3.2/QTvtkConsole'
>
> mingw32-make: *** [debug] Error 2
>
>  
>
> But when i removed LIBS  i had:
>
>  
>
> mingw32-make debug
>
> mingw32-make -f Makefile.Debug
>
> mingw32-make[1]: Entering directory 
> `F:/MisProyectosEclipse3.2/QTvtkConsole'
>
> g++ -mthreads -Wl,-enable-stdcall-fixup -Wl,-enable-auto-import 
> -Wl,-enable-runtime-pseudo-reloc -Wl,-subsystem,windows -o 
> "debug\QTvtkConsole.exe" debug\Cone.o -L"c:\Qt\4.1.4\lib" -lopengl32 
> -lglu32 -lgdi32 -luser32 -lmingw32 -lqtmaind -lQtOpenGLd4 -lQtGuid4 
> -lQtCored4
>
> debug\Cone.o(.text+0x107): In function `Z5qMainiPPc':
>
> F:/MisProyectosEclipse3.2/QTvtkConsole/Cone.cc:12: undefined reference 
> to `_imp___ZN11vtkRenderer3NewEv'
>
> debug\Cone.o(.text+0x111):F:/MisProyectosEclipse3.2/QTvtkConsole/Cone.cc:14: 
> undefined reference to `_imp___ZN15vtkRenderWindow3NewEv'
>
> debug\Cone.o(.text+0x15c):F:/MisProyectosEclipse3.2/QTvtkConsole/Cone.cc:19: 
> undefined reference to `_imp___ZN13vtkConeSource3NewEv'
>
> debug\Cone.o(.text+0x183):F:/MisProyectosEclipse3.2/QTvtkConsole/Cone.cc:21: 
> undefined reference to `_imp___ZN17vtkPolyDataMapper3NewEv'
>
> debug\Cone.o(.text+0x193):F:/MisProyectosEclipse3.2/QTvtkConsole/Cone.cc:22: 
> undefined reference to `_imp___ZN20vtkPolyDataAlgorithm9GetOutputEv'
>
> debug\Cone.o(.text+0x1a4):F:/MisProyectosEclipse3.2/QTvtkConsole/Cone.cc:22: 
> undefined reference to 
> `_imp___ZN17vtkPolyDataMapper8SetInputEP11vtkPolyData'
>
> debug\Cone.o(.text+0x1ab):F:/MisProyectosEclipse3.2/QTvtkConsole/Cone.cc:23: 
> undefined reference to `_imp___ZN8vtkActor3NewEv'
>
> debug\Cone.o(.text+0x1de):F:/MisProyectosEclipse3.2/QTvtkConsole/Cone.cc:27: 
> undefined reference to `_imp___ZN11vtkRenderer8AddActorEP7vtkProp'
>
> collect2: ld returned 1 exit status
>
> mingw32-make[1]: *** [debug\QTvtkConsole.exe] Error 1
>
> mingw32-make[1]: Leaving directory 
> `F:/MisProyectosEclipse3.2/QTvtkConsole'
>
> mingw32-make: *** [debug] Error 2
>
>  
>
>  
>
> Could someone tell me why i get the message No such file: Permission 
> denied and how i can run VTK ??
>
>  
>
> thanks in advance, a lot
>
> José
>
>  
>
>  
>
>  
>
>  
>
>
> ------------------------------------------------------------------------
> Tecnología, moda, motor, viajes,…suscríbete a nuestros boletines para 
> estar a la última MSN Newsletters 
> <http://newsletters.msn.com/hm/maintenanceeses.asp?L=ES&C=ES&P=WCMaintenance&Brand=WL&RU=http%3a%2f%2fmail.live.com> 
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> 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
>   

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20071203/8e9d5a0f/attachment.htm>


More information about the vtkusers mailing list