[vtkusers] trouble setting up VTK for Qt creator

Clinton Stimpson clinton at elemtech.com
Wed Jul 27 16:15:27 EDT 2011


On Wednesday, July 27, 2011 01:33:54 pm com wrote:
> I want to use Qt Creator as my IDE, not Visual Studio and want to get VTK
> to work for Qt Creator. The problem is that it CMake doesn't let me select
> Qt Creator as a compiler in their code and I don't have any other
> compilers that are compatible. 

Qt Creator is not a compiler, but is an IDE.  It can work with different 
compilers and different Qt installations.  You just need to match your compiler 
(e.g. mingw or MSVC) with the Qt installation you want to use.

CMake will let you choose the following that should with Qt Creator:
CodeBlocks - MinGW Makefiles
CodeBlocks - NMake Makefiles
CodeBlocks - Unix Makefiles

> I don't mind rebuilding Qt Creator with
> Visual Studio - although I'm not exactly sure how to do that. 

No need to do that (in fact is already is built with Visual Studio, but comes 
with a mingw built Qt installation).

> However, if
> I could use another compiler that would produce compatible code to Qt
> Creator, then I would prefer that option, even if it meant downloading
> another compiler just to build VTK - and then I could hopefully get VTK to
> work in Qt Creator.

Hopefully you already installed the mingw compiler as part of the Qt SDK 
installation.
Try this:
run cmake-gui
generate your project with the "CodeBlocks - MinGW Makefiles" and choose 
C:\QtSDK\Desktop\Qt\4.7.3\mingw\bin\qmake.exe for QT_QMAKE_EXECUTABLE.
cmake-gui will give you more interactivity than Qt Creator's cmake dialog if 
you do the initial project set up there.

Once that is working, open Qt Creator and do File -> Open and choose the 
CMakeLists.txt file for your project.  In the next dialog, fill in the build 
directory where you previously told cmake-gui to generate the project.
Hit the "Run CMake" and finish button in that dialog.

Clint

> 
> On Wed, Jul 27, 2011 at 12:41 PM, lindeval [via VTK] <
> 
> ml-node+4639639-1739892668-235024 at n5.nabble.com> wrote:
> > The message "It Appears you're Trying to use Visual Studio with Qt built
> > by mingw" is due to the fact that you can not use Qt in visual studio if
> > Qt was built with mingw. If you want to use Qt with Visual Studio,
> > compile Qt with Visual Studio.
> > 
> > Do not forget to enable the "VTK_USE_QVTK_QTOPENGL ' in cmake.
> > 
> > ----- Mensagem original -----
> > De: "com" <[hidden
> > email]<http://user/SendEmail.jtp?type=node&node=4639639&i=0>>
> > 
> > Para: [hidden
> > email]<http://user/SendEmail.jtp?type=node&node=4639639&i=1> Enviadas:
> > Quarta-feira, 27 de Julho de 2011 13:42:08 (GMT-0300)
> > Auto-Detected
> > Assunto: Re: [vtkusers] trouble setting up VTK for Qt creator
> > 
> > 
> > I tried using the path C:\QtSDK\Desktop\Qt\4.7.3\mingw\bin\qmake.exe for
> > the QT_QMAKE_EXECUTABLE, but got this message.
> > 
> > CMake Error at C:/Program Files (x86)/CMake
> > 2.8/share/cmake-2.8/Modules/FindQt4.cmake:575 (MESSAGE):
> > 
> > It appears you're trying to use Visual Studio with Qt built by mingw.
> > 
> > Those compilers do not produce code compatible with each other.
> > 
> > Call Stack (most recent call first):
> > 
> > CMakeLists.txt:305 (FIND_PACKAGE)
> > 
> > 
> > 
> > 
> > Also, I used the path C:/QtSDK/Desktop/Qt/4.7.3/mingw/include/QtDesigner
> > for the QT_QTDESIGNER_INCLUDE_DIR. I also tried it leaving this blank and
> > got a similar message.
> > 
> > 
> > 
> > Qt Creator wasn't on the list of generators used by CMake, so I used
> > Visual Studio 10 as my generator (that's the only other compiler on my
> > computer besides Qt Creator). I noticed Code Blocks could be used as a
> > generator in CMake. I'm guessing I could download this and use it as the
> > generator and then it (might??) be compatible with Qt Creator. I'd
> > rather find another way around this problem if possible, but if I have
> > to, I can go down this route.
> > 
> > 
> > 
> > 
> > 
> > 2011/7/27 Dženan Zukić [via VTK] < [hidden email] >
> > 
> > 
> > 
> > You should use the one from the library that you want to use. I guess
> > that is:
> > 
> > 
> > C:\QtSDK\Desktop\Qt\4.73\ mingw\bin
> > 
> > 
> > 
> > On Wed, Jul 27, 2011 at 15:14, com < [hidden email] > wrote:
> > 
> > 
> > 
> > Thanks for the advice Dominik. I did a search for qmake.exe in my QTSDK
> > directory and found it in a number of different directories.Here they
> > are,
> > 
> > C:\QtSDK\Symbian\SDKs\Symbian1Qt473\bin
> > C:\QtSDK\Symbian\SDKs\Symbian3Qt473\bin
> > C:\QtSDK\Symbian\SDKs\Symbian3Qt463\bin
> > C:\QtSDK\Symbian\SDKs\Symbian1Qt463\bin
> > C:\QtSDK\Simulator\Qt\mingw\bin
> > C:\QtSDK\Desktop\Qt\4.73\mingw\bin
> > 
> > Do you know which one should I use?
> > 
> > Thanks
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > On Tue, Jul 26, 2011 at 5:00 PM, Dominik Szczerba [via VTK] < [hidden
> > email] > wrote:
> > 
> > 
> > 
> > 
> > You need to provide the path to qmake.exe when running cmake.
> > 
> > Dominik
> > 
> > On Tue, Jul 26, 2011 at 11:45 PM, com < [hidden email] > wrote:
> > > I am trying to set up VTK for Qt Creator. I saw some step by step
> > > guides
> > 
> > for
> > 
> > > setting up VTK for visual studio, but none for Qt Creator. I have
> > > visual studio, but would rather use Qt Creator.
> > > 
> > > I downloaded the latest versions of VTK and CMake and have Qt 4.7.3. If
> > > I
> > 
> > do
> > 
> > > not select VTK_USE_QT, then CMake seems to build VTK with no problems -
> > > which might be fine if I was just using visual studio. However, when I
> > > select VTK_USE_QT I run into a number of errors.
> > > 
> > > Here are a few of the errors:
> > > 
> > > Qt QTGUI library not found
> > > Qt QTSQL library not found
> > > Qt QTNETWORK library not found
> > > 
> > > CMake doesn't seem to be able to find a lot of these - so I tried
> > > putting
> > 
> > in
> > 
> > > the values myself and still seem to get some errors. Maybe I'm putting
> > > in
> > > 
> > > the wrong values?
> > > 
> > > Any help would be much appreciated as I have spent the whole day trying
> > 
> > to
> > 
> > > figure out how to get this to work and I would really like to use VTK
> > > for
> > 
> > a
> > 
> > > project I am working on in graduate school. I'm also not sure what I
> > > need
> > 
> > to
> > 
> > > do in Qt Creator once I'm done with CMake.
> > > 
> > > 
> > > --
> > 
> > > View this message in context:
> > http://vtk.1045678.n5.nabble.com/trouble-setting-up-VTK-for-Qt-creator-tp
> > 4636528p4636528.html > Sent from the VTK - Users mailing list archive at
> > Nabble.com.
> > 
> > > _______________________________________________
> > > 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
> > > 
> > > _______________________________________________
> > 
> > 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
> > 
> > 
> > 
> > 
> > 
> > If you reply to this email, your message will be added to the discussion
> > below:
> > http://vtk.1045678.n5.nabble.com/trouble-setting-up-VTK-for-Qt-creator-tp
> > 4636528p4636577.html
> > 
> > To unsubscribe from trouble setting up VTK for Qt creator, click here .
> > 
> > 
> > View this message in context: Re: trouble setting up VTK for Qt creator
> > 
> > 
> > 
> > 
> > Sent from the VTK - Users mailing list archive at Nabble.com.
> > 
> > _______________________________________________
> > 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
> > 
> > 
> > 
> > 
> > _______________________________________________
> > 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
> > 
> > 
> > 
> > 
> > 
> > 
> > If you reply to this email, your message will be added to the discussion
> > below:
> > http://vtk.1045678.n5.nabble.com/trouble-setting-up-VTK-for-Qt-creator-tp
> > 4636528p4639052.html
> > 
> > 
> > 
> > 
> > To unsubscribe from trouble setting up VTK for Qt creator, click here .
> > 
> > 
> > View this message in context: Re: trouble setting up VTK for Qt creator
> > Sent from the VTK - Users mailing list archive at Nabble.com.
> > 
> > _______________________________________________
> > 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
> > _______________________________________________
> > 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
> > 
> > 
> > ------------------------------
> > 
> >  If you reply to this email, your message will be added to the discussion
> > 
> > below:
> > 
> > http://vtk.1045678.n5.nabble.com/trouble-setting-up-VTK-for-Qt-creator-tp
> > 4636528p4639639.html
> > 
> >  To unsubscribe from trouble setting up VTK for Qt creator, click
> >  here<http://vtk.1045678.n5.nabble.com/template/NamlServlet.jtp?macro=un
> >  subscribe_by_code&node=4636528&code=Y29tYWNrZUBnbWFpbC5jb218NDYzNjUyOHw4
> >  ODA1ODg2MjI=>.
> 
> --
> View this message in context:
> http://vtk.1045678.n5.nabble.com/trouble-setting-up-VTK-for-Qt-creator-tp4
> 636528p4640052.html Sent from the VTK - Users mailing list archive at
> Nabble.com.

-- 
Clinton Stimpson
Elemental Technologies, Inc
Computational Simulation Software, LLC
www.csimsoft.com



More information about the vtkusers mailing list