Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved] Build Qt 5.2.1 + VTK 6.1.0 + CMake 2.8.12.2
Forum Updated to NodeBB v4.3 + New Features

[Solved] Build Qt 5.2.1 + VTK 6.1.0 + CMake 2.8.12.2

Scheduled Pinned Locked Moved General and Desktop
18 Posts 2 Posters 14.9k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mpcarlos87
    wrote on 16 Apr 2014, 15:43 last edited by
    #1

    EDIT: OSX 10.9 problem Solved at the first post of the second page.
    EDIT: Windows problem Solved a few posts down!

    Hi all,

    Im trying to build VTK libraries with CMake and Qt 5.2.1 to use it inside the QT Creator. First i tried in Windows and i had to add this lines to the CMakeLists.txt (Because VTK tried to use QT4):

    @if(WIN32)
    set(CMAKE_LIBRARY_PATH "$ENV{PROGRAMFILES(X86)}\Windows Kits\8.0\Lib\win8\um\x64")
    endif()

    SET(VTK_QT_VERSION "5")
    SET(VTK_Group_Qt 1)@

    After that i could generate the project and compile it with visual studio 2012. Later, i copied the QVTKWidget into the plugins/designer of the qt-creator, but the QVTKWidget didnt appear into the editor.

    I tried also to do it in OSX (same versions of all), and i managed to configure and generate the make files to compile VTK, but when i compiled it , i got an error:

    @error: garbage collection is no longer supported
    make[2]: *** [Rendering/OpenGL/CMakeFiles/vtkRenderingOpenGL.dir/vtkCocoaRenderWindowInteractor.mm.o] Error 1
    make[1]: *** [[Rendering/OpenGL/CMakeFiles/vtkRenderingOpenGL.dir/all] Error 2
    make[1]: *** Waiting for unfinished jobs...@

    Can someone help me to got this working? Thanks in advance :).

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 16 Apr 2014, 19:27 last edited by
      #2

      Hi and welcome to devnet,

      The probable problem you have on Windows is that the Qt and compiler version you used to build the plugin doesn't match Qt Creator's Qt

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mpcarlos87
        wrote on 16 Apr 2014, 20:31 last edited by
        #3

        Hi SGaist and thanks for the answer and the welcome!

        I didn't understand what do you mean about the matching of Qt Creator's Qt. I did it with this versions:

        CMake 2.8.12 ( Visual studio 11 x64 compiler) + VTK 6.10 + Qt Options into CMake = VTK Compiled for use with QT (all correct using the flags i told before).

        Then i got the QVTKWidget.dll and .lib and i copied them into the Qt installation (plugins/designer) as i saw in some tutorials, but QtCreator doesn't detect them (And QVTKWidget doesn't appear into the editor). Can you explain it please?

        Thanks again!

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 16 Apr 2014, 20:41 last edited by
          #4

          AFAIK, Qt Creator is build once and shipped with the necessary Qt libraries for all windows packages. Qt Creator is not tied to the Qt version you use for your development.

          When you create a plugin, you must use the same compiler and Qt version that were used to build Qt Creator.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mpcarlos87
            wrote on 17 Apr 2014, 11:39 last edited by
            #5

            Hi again SGaist,

            Finally i found the problem. I tried to open QTCreator (which i don't know with what version of Qt uses to compile ^^) but instead of that, i found that i must open the Designer.exe of Qt to edit the .ui files. Into the designer appears the QVTKWidget(in QtCreator doesn't appear) and i can integrate it with my Qt App :).

            Thanks for all!!!

            In OSX i didn't found the solution yet...if anyone could help me with the configuration i'll appreciate it!!

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 17 Apr 2014, 11:48 last edited by
              #6

              You're welcome !

              Are you sure you copied the plugin at the right place ? Have a look at the Qt Creator's documentation, there's a chapter about creating plugins and IIRC they also talk about the designer plugin

              What configuration problem do you have on OS X?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • M Offline
                M Offline
                mpcarlos87
                wrote on 17 Apr 2014, 12:54 last edited by
                #7

                I'll take a look into the Qt Creator documentation to see if i place it in the right place :).

                About the problem with OSX, i described it into the first post:

                I managed to configure and generate the unix make files to compile VTK, but when i compiled it , i got an error:

                @error: garbage collection is no longer supported
                make[2]: *** [Rendering/OpenGL/CMakeFiles/vtkRenderingOpenGL.dir/vtkCocoaRenderWindowInteractor.mm.o] Error 1
                make[1]: *** [[Rendering/OpenGL/CMakeFiles/vtkRenderingOpenGL.dir/all] Error 2
                make[1]: *** Waiting for unfinished jobs...@

                I don't know how to solve it!

                Thanks!!

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 17 Apr 2014, 20:50 last edited by
                  #8

                  I would say, you are using a "too recent" version of Xcode, have a look at the project for something like "GCC_ENABLE_OBJC_GC = supported;" and remove it

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0
                  • M Offline
                    M Offline
                    mpcarlos87
                    wrote on 22 Apr 2014, 13:55 last edited by
                    #9

                    Sorry im a little lost (just starting with OSX, QT and VTK...). I'm compiling with "make" and i'm not using XCode for anything. Where can i found that option?

                    1 Reply Last reply
                    0
                    • S Offline
                      S Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on 22 Apr 2014, 20:11 last edited by
                      #10

                      Somewhere in your Makefile then. grep through them for GCC_ENABLE_OBJC_GC

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      1 Reply Last reply
                      0
                      • M Offline
                        M Offline
                        mpcarlos87
                        wrote on 23 Apr 2014, 07:32 last edited by
                        #11

                        Hi again SGaist and thanks for your patience,

                        I searched for GCC_ENABLE_OBJ_GC at the Makefile, and is not in there. I tried building with XCode and the same error appears, so i looked for that into the "Build Settings" in XCode and it doesn't appear, so i defined it and set it to unsupported (just testing). Again i got the same error (Garbage collection is no longer supported).
                        By the way, as i see into the "documentation":https://developer.apple.com/library/mac/documentation/DeveloperTools/Reference/XcodeBuildSettingRef/1-Build_Setting_Reference/build_setting_ref.html , the default value is unsupported, but seems that the problem is here because of the message.

                        I'll be trying to solve this, what do you think?

                        Thanks again.

                        1 Reply Last reply
                        0
                        • S Offline
                          S Offline
                          SGaist
                          Lifetime Qt Champion
                          wrote on 23 Apr 2014, 20:14 last edited by
                          #12

                          Did you search in the sources ?

                          Interested in AI ? www.idiap.ch
                          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                          1 Reply Last reply
                          0
                          • M Offline
                            M Offline
                            mpcarlos87
                            wrote on 24 Apr 2014, 07:15 last edited by
                            #13

                            I searched into the sources, the "Makefile" build and the "XCode" build with GREP recursively into the folder tree but no result was found!

                            1 Reply Last reply
                            0
                            • S Offline
                              S Offline
                              SGaist
                              Lifetime Qt Champion
                              wrote on 24 Apr 2014, 19:09 last edited by
                              #14

                              And the Xcode project itself ?

                              Interested in AI ? www.idiap.ch
                              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                              1 Reply Last reply
                              0
                              • M Offline
                                M Offline
                                mpcarlos87
                                wrote on 24 Apr 2014, 21:13 last edited by
                                #15

                                Into the “Build Settings” in XCode i couldn't find it (The documentation says it must be defined there, but if it isn't, it's "unsupported" by default).

                                Thanks for your help.

                                1 Reply Last reply
                                0
                                • S Offline
                                  S Offline
                                  SGaist
                                  Lifetime Qt Champion
                                  wrote on 25 Apr 2014, 19:38 last edited by
                                  #16

                                  Did you search for only garbage ?

                                  Interested in AI ? www.idiap.ch
                                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                  1 Reply Last reply
                                  0
                                  • M Offline
                                    M Offline
                                    mpcarlos87
                                    wrote on 28 Apr 2014, 20:08 last edited by
                                    #17

                                    Hello again,

                                    Finally I got the answer just searching the web! After the changes i could compile VTK and QT together :).

                                    The problem was at the CMakeLists of VTK and not on the QT ones. It was one feature not supported by XCode as you say (VTK_REQUIRED_OBJCXX_FLAGS ). The problem will be solved in VTK 6.2 as you can see in the Summary of changes: "http://www.vtk.org/Wiki/VTK#Summary_of_Changes":http://www.vtk.org/Wiki/VTK#Summary_of_Changes

                                    If anyone gets this problem, just delete or comment this lines from the CMakeList.txt at the top of the VTK source:

                                    @IF(APPLE)

                                    Being a library, VTK may be linked in either GC (garbage collected)

                                    processes or non-GC processes. Default to "GC supported" so that both

                                    GC and MRR (manual reference counting) are supported.

                                    SET(VTK_OBJCXX_FLAGS_DEFAULT "-fobjc-gc")
                                    SET(VTK_REQUIRED_OBJCXX_FLAGS ${VTK_OBJCXX_FLAGS_DEFAULT} CACHE STRING "Extra flags for Objective-C++ compilation")
                                    MARK_AS_ADVANCED(VTK_REQUIRED_OBJCXX_FLAGS)
                                    ENDIF(APPLE)@

                                    As you see the problem is solved at VTK github repository setting this flag to empty : "VTK CMakeLists":https://github.com/Kitware/VTK/blob/master/CMakeLists.txt

                                    Thank you so much for your help and i hope i will continue contributing here as a Qt developer =).

                                    1 Reply Last reply
                                    0
                                    • S Offline
                                      S Offline
                                      SGaist
                                      Lifetime Qt Champion
                                      wrote on 28 Apr 2014, 20:57 last edited by
                                      #18

                                      You're welcome !

                                      Glad you found out !

                                      Sure you will :)

                                      Happy coding !

                                      Interested in AI ? www.idiap.ch
                                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                      1 Reply Last reply
                                      0

                                      6/18

                                      17 Apr 2014, 11:48

                                      topic:navigator.unread, 12
                                      • Login

                                      • Login or register to search.
                                      6 out of 18
                                      • First post
                                        6/18
                                        Last post
                                      0
                                      • Categories
                                      • Recent
                                      • Tags
                                      • Popular
                                      • Users
                                      • Groups
                                      • Search
                                      • Get Qt Extensions
                                      • Unsolved