[vtkusers] Qt Example build errors

Dean Inglis dean.inglis at camris.ca
Tue Aug 17 11:55:36 EDT 2010


Hi David,

seems that the header blockers in SimpleViewUI.h
also were wrong, so I edited them on the wiki
#ifndef SimpleView_H
#define SimpleView_H

are now

#ifndef SimpleViewUI_H
#define SimpleViewUI_H

works fine now!

Dean

----- Original Message ----- 
From: "David Doria" <daviddoria+vtk at gmail.com>
To: "Dean Inglis" <dean.inglis at camris.ca>
Cc: "vtkusers archive" <vtkusers at vtk.org>
Sent: Tuesday, August 17, 2010 11:24 AM
Subject: Re: [vtkusers] Qt Example build errors


On Tue, Aug 17, 2010 at 10:49 AM, Dean Inglis <dean.inglis at camris.ca> wrote:
> Im trying out Qt (Im a Qt newbie) with VTK under MinGW on Win32 Vista,
> CMake 2.8, shared builds of Qt and VTK. I ran into a
> few snags while compiling code from the Wiki 
> Examples/Cxx/Qt/RendewWindowUi.
>
> 1) SimpleViewUI.cxx refers to a missing header: ui_SimpleView.h
>
> here is the error output from mingw32-make:
>
> D:\Developer\Releases\MinGW\SHARED\vtkQt\Qt2>mingw32-make
> [ 20%] Building CXX object
> CMakeFiles/RenderWindowUI.dir/SimpleViewUI.cxx.obj
> D:\Developer\Sources\Auxiliary\QtExamples\Qt2\SimpleViewUI.cxx:1:27:
> ui_SimpleVi
> ew.h: No such file or directory
> D:\Developer\Sources\Auxiliary\QtExamples\Qt2\SimpleViewUI.cxx: In
> constructor `
> SimpleView::SimpleView()':
> D:\Developer\Sources\Auxiliary\QtExamples\Qt2\SimpleViewUI.cxx:18: error:
> invali
> d use of undefined type `struct Ui_SimpleView'
> D:\Developer\Sources\Auxiliary\QtExamples\Qt2\SimpleViewUI.h:8: error:
> forward d
> eclaration of `struct Ui_SimpleView'
> D:\Developer\Sources\Auxiliary\QtExamples\Qt2\SimpleViewUI.cxx:19: error:
> invali
> d use of undefined type `struct Ui_SimpleView'
> D:\Developer\Sources\Auxiliary\QtExamples\Qt2\SimpleViewUI.h:8: error:
> forward d
> eclaration of `struct Ui_SimpleView'
> D:\Developer\Sources\Auxiliary\QtExamples\Qt2\SimpleViewUI.cxx:38: error:
> invali
> d use of undefined type `struct Ui_SimpleView'
> D:\Developer\Sources\Auxiliary\QtExamples\Qt2\SimpleViewUI.h:8: error:
> forward d
> eclaration of `struct Ui_SimpleView'
> D:\Developer\Sources\Auxiliary\QtExamples\Qt2\SimpleViewUI.cxx:41: error:
> invali
> d use of undefined type `struct Ui_SimpleView'
> D:\Developer\Sources\Auxiliary\QtExamples\Qt2\SimpleViewUI.h:8: error:
> forward d
> eclaration of `struct Ui_SimpleView'
> D:\Developer\Sources\Auxiliary\QtExamples\Qt2\SimpleViewUI.cxx: In member
> functi
> on `virtual void SimpleView::slotExit()':
> D:\Developer\Sources\Auxiliary\QtExamples\Qt2\SimpleViewUI.cxx:47: error:
> `qApp'
> was not declared in this scope
> mingw32-make[2]: *** [CMakeFiles/RenderWindowUI.dir/SimpleViewUI.cxx.obj]
> Error
> 1
> mingw32-make[1]: *** [CMakeFiles/RenderWindowUI.dir/all] Error 2
> mingw32-make: *** [all] Error 2
>
> 2) I tried opening up SimpleViewUI.ui in Qt Designer and while loading I 
> get
> a popup error message:
> The specified qrc file
> D:/Developer/Sources/Auxiliary/QtExamples/Qt2/Icons/icons.qrc
> could not be found. Do you want to update the file location?
>
>
> Dean

Hi Dean,

There were some errors in the example. Give it a shot now.

One thing to note is that ui_SimpleViewUI.h (there was a problem with
the name before, but it should be fixed now) is actually GENERATED in
your build directory when you run CMake on your project. (That is why
you don't have to copy/paste this file from the wiki.)

Also make sure you do this:
http://www.vtk.org/Wiki/VTK/Tutorials/QtSetup

Let me know how it goes. Be patient with Qt... it was pretty annoying
getting to work at first, but I love it now that I "know what I'm
doing".

David 




More information about the vtkusers mailing list