Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. C++ Gurus
  4. Add VTK library to Qt project

Add VTK library to Qt project

Scheduled Pinned Locked Moved Solved C++ Gurus
vtk
42 Posts 3 Posters 15.9k Views
  • 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.
  • S Offline
    S Offline
    SGaist
    Lifetime Qt Champion
    wrote on 6 Dec 2019, 22:02 last edited by
    #12

    Do you have the same issue in Debug mode ?

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

    P 1 Reply Last reply 7 Dec 2019, 09:04
    0
    • S SGaist
      6 Dec 2019, 22:02

      Do you have the same issue in Debug mode ?

      P Offline
      P Offline
      Please_Help_me_D
      wrote on 7 Dec 2019, 09:04 last edited by
      #13

      @SGaist yes, the behavior is the same in release and debug mode

      1 Reply Last reply
      0
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 7 Dec 2019, 21:27 last edited by
        #14

        In that case, run your application using the debugger. It will allow you to gather more information on what is going on.

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

        P 1 Reply Last reply 8 Dec 2019, 01:07
        0
        • S SGaist
          7 Dec 2019, 21:27

          In that case, run your application using the debugger. It will allow you to gather more information on what is going on.

          P Offline
          P Offline
          Please_Help_me_D
          wrote on 8 Dec 2019, 01:07 last edited by
          #15

          @SGaist I can't put a "break point" beacause in this case I get the error: "cdb stopped".
          If I just run app in debug mode I get the application output:

          04:05:17: C: \ Users \ Tasik \ Documents \ Qt_prj \ build-VTK-Desktop_Qt_5_12_5_MSVC2017_64bit-Debug \ debug \ VTK.exe starts ...
          04:05:17: The program ended unexpectedly.
          04:05:17: The process was completed forcibly.
          04:05:17: C: /Users/Tasik/Documents/Qt_prj/build-VTK-Desktop_Qt_5_12_5_MSVC2017_64bit-Debug/debug/VTK.exe failed.
          

          and compiler output:

          04:05:17: Steps are being carried out for the VTK project ...
          04:05:17: Settings have not changed, the qmake stage is skipped.
          04:05:17: It starts: "C: \ Qt \ Tools \ qtcreator-4.10.2 \ bin \ jom.exe"
          C: \ Qt \ Tools \ qtcreator-4.10.2 \ bin \ jom.exe -f Makefile.Debug
          04:05:17: The process "C: \ Qt \ Tools \ qtcreator-4.10.2 \ bin \ jom.exe" completed successfully.
          04:05:17: Elapsed time: 00:00.
          
          1 Reply Last reply
          0
          • S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 8 Dec 2019, 20:18 last edited by
            #16

            How did you install the debugger ?

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

            P 1 Reply Last reply 8 Dec 2019, 23:56
            0
            • S SGaist
              8 Dec 2019, 20:18

              How did you install the debugger ?

              P Offline
              P Offline
              Please_Help_me_D
              wrote on 8 Dec 2019, 23:56 last edited by
              #17

              @SGaist I don't know exactly but I think it was installed with Visual Studio 2017. Isn'it?

              J 1 Reply Last reply 9 Dec 2019, 05:28
              0
              • P Please_Help_me_D
                8 Dec 2019, 23:56

                @SGaist I don't know exactly but I think it was installed with Visual Studio 2017. Isn'it?

                J Offline
                J Offline
                jsulm
                Lifetime Qt Champion
                wrote on 9 Dec 2019, 05:28 last edited by
                #18

                @Please_Help_me_D said in Add VTK library to Qt project:

                Isn'it?

                No, the debugger in Visual Studio can't be used outside of Visual Studio.
                You need to install Debugging Tools for Windows/CDB.
                See https://doc.qt.io/qtcreator/creator-debugger-engines.html

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                P 1 Reply Last reply 9 Dec 2019, 15:55
                0
                • J jsulm
                  9 Dec 2019, 05:28

                  @Please_Help_me_D said in Add VTK library to Qt project:

                  Isn'it?

                  No, the debugger in Visual Studio can't be used outside of Visual Studio.
                  You need to install Debugging Tools for Windows/CDB.
                  See https://doc.qt.io/qtcreator/creator-debugger-engines.html

                  P Offline
                  P Offline
                  Please_Help_me_D
                  wrote on 9 Dec 2019, 15:55 last edited by
                  #19

                  @jsulm thank you
                  My debugger is in folder: C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\cdb.exe
                  Then I don't know how it was installed. It was already installed by the time when I installed Qt. Should I install some new debugger?
                  By the way in most application I can set a breakpoint and work with debugger. But in this case it doesn't work.

                  1 Reply Last reply
                  0
                  • P Offline
                    P Offline
                    Please_Help_me_D
                    wrote on 9 Dec 2019, 16:20 last edited by
                    #20

                    I set up CDB path as it said in link text but still doesn't work.
                    Am I right that if my CDB installed properly then it should run my app and if some problem occurs then an error should appear that more detailed describes my problem?

                    1 Reply Last reply
                    0
                    • S Offline
                      S Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on 9 Dec 2019, 18:36 last edited by
                      #21

                      Did you check that your debugger is for the right architecture ?

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

                      P 1 Reply Last reply 9 Dec 2019, 19:22
                      0
                      • S SGaist
                        9 Dec 2019, 18:36

                        Did you check that your debugger is for the right architecture ?

                        P Offline
                        P Offline
                        Please_Help_me_D
                        wrote on 9 Dec 2019, 19:22 last edited by
                        #22

                        @SGaist I think so. There are several of them for different compilators and architectures and I think Qt choses the right one for my x64 application
                        Debugger.jpg

                        1 Reply Last reply
                        0
                        • S Offline
                          S Offline
                          SGaist
                          Lifetime Qt Champion
                          wrote on 9 Dec 2019, 20:28 last edited by
                          #23

                          Did you check that it's the correct one that is selected for the kit you are using ?

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

                          P 2 Replies Last reply 9 Dec 2019, 20:56
                          0
                          • S SGaist
                            9 Dec 2019, 20:28

                            Did you check that it's the correct one that is selected for the kit you are using ?

                            P Offline
                            P Offline
                            Please_Help_me_D
                            wrote on 9 Dec 2019, 20:56 last edited by
                            #24

                            @SGaist Yes. I just checked itDebugger1.jpg

                            1 Reply Last reply
                            0
                            • S SGaist
                              9 Dec 2019, 20:28

                              Did you check that it's the correct one that is selected for the kit you are using ?

                              P Offline
                              P Offline
                              Please_Help_me_D
                              wrote on 10 Dec 2019, 15:56 last edited by Please_Help_me_D 12 Oct 2019, 16:03
                              #25

                              @SGaist @jsulm I think I have found the reason why I used to not get any meaningful errors. From here I turned off the Windows "Fault Tolerant Heap" and now I get the error:

                              cannot open C:\Windows\main.obj.5848.31.jom for write
                              

                              But I dont have any file in that folder with name "main..."

                              1 Reply Last reply
                              0
                              • S Offline
                                S Offline
                                SGaist
                                Lifetime Qt Champion
                                wrote on 10 Dec 2019, 20:57 last edited by
                                #26

                                And you should not. There's no reason for the build system to try to write to that folder. You should do a full clean rebuild.

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

                                P 1 Reply Last reply 10 Dec 2019, 22:53
                                0
                                • S SGaist
                                  10 Dec 2019, 20:57

                                  And you should not. There's no reason for the build system to try to write to that folder. You should do a full clean rebuild.

                                  P Offline
                                  P Offline
                                  Please_Help_me_D
                                  wrote on 10 Dec 2019, 22:53 last edited by Please_Help_me_D 12 Oct 2019, 23:35
                                  #27

                                  @SGaist Thank you, I think the problem was solved.
                                  What did I do:
                                  After I rebuild the project I got the error:

                                  ERROR: In D:\Qt\Downloaded\VTK-8.2.0\Rendering\Core\vtkTextMapper.cxx, line 550
                                  vtkOpenGLTextMapper (0000000002D23D40): Could not locate vtkTextRenderer object.
                                  

                                  Here I saw the solution for that problem. Now to run any VTK example I add:

                                  #include <vtkAutoInit.h>
                                  VTK_MODULE_INIT(vtkRenderingOpenGL2);
                                  VTK_MODULE_INIT(vtkRenderingContextOpenGL2); // this is for 2D graphics [link](http://vtk.1045678.n5.nabble.com/Error-no-override-found-for-vtkContextDevice2D-td5741533.html)
                                  VTK_MODULE_INIT(vtkInteractionStyle);
                                  VTK_MODULE_INIT(vtkRenderingFreeType);
                                  

                                  But I'm interested why the error say somethink about D:\Qt\Downloaded\VTK-8.2.0\Rendering\Core\vtkTextMapper.cxx? Here I have only unpacked VTK folder and it is installed in C:\apps\MSVC_apps_debug\VTK
                                  Why the error refers to the folder where VTK was simply downloaded?

                                  1 Reply Last reply
                                  0
                                  • S Offline
                                    S Offline
                                    SGaist
                                    Lifetime Qt Champion
                                    wrote on 10 Dec 2019, 23:22 last edited by
                                    #28

                                    You should take a look at the code where the message is generated. That might give you some clues.

                                    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
                                    1
                                    • P Offline
                                      P Offline
                                      Please_Help_me_D
                                      wrote on 1 Jan 2020, 00:59 last edited by
                                      #29

                                      I have the same problem once again.
                                      After I reinstalled Windows 7 to Windows 10 I can run some simple examples from VTK web-site. But some other examples don't work and I the problem is that I dont get any error message. For example I delete all build folder and run app in debug mode and Qmake compiler output:

                                      03:44:37: The steps for the VTK project are being carried out ...
                                      03:44:37: It starts: "C: \ Qt \ 5.12.6 \ msvc2017_64 \ bin \ qmake.exe" C: \ Users \ tasik \ Documents \ Qt_Projects \ VTK \ VTK.pro -spec win32-msvc "CONFIG + = debug "" CONFIG + = qml_debug "
                                      Info: creating stash file C: \ Users \ tasik \ Documents \ Qt_Projects \ build-VTK-Desktop_Qt_5_12_6_MSVC2017_64_bit-Debug \ .qmake.stash
                                      03:44:39: The process "C: \ Qt \ 5.12.6 \ msvc2017_64 \ bin \ qmake.exe" completed successfully.
                                      03:44:39: It starts: "C: \ Qt \ Tools \ qtcreator-4.11.0 \ bin \ jom.exe" -f C: / Users / tasik / Documents / Qt_Projects / build-VTK-Desktop_Qt_5_12_6_MSVC2017_64_bit-Debug / Makefile qmake_all
                                      
                                      jom 1.1.3 - empower your cores   // THIS IS HIGHLITED WITH RED COLOR
                                      
                                      03:44:39: The process "C: \ Qt \ Tools \ qtcreator-4.11.0 \ bin \ jom.exe" completed successfully.
                                      03:44:39: Elapsed time: 00:02.
                                      

                                      Then I run debug and I get:

                                      03:48:45: The stages for the VTK project are being executed ...
                                      03:48:45: Settings have not changed, the qmake stage is skipped.
                                      03:48:45: It starts: "C: \ Qt \ Tools \ qtcreator-4.11.0 \ bin \ jom.exe"
                                      C: \ Qt \ Tools \ qtcreator-4.11.0 \ bin \ jom.exe -f Makefile.Debug
                                      C: \ Qt \ 5.12.6 \ msvc2017_64 \ bin \ uic.exe .. \ VTK \ mainwindow.ui -o ui_mainwindow.h
                                      cl -c -nologo -Zc: wchar_t -FS -Zc: rvalueCast -Zc: inline -Zc: strictStrings -Zc: throwingNew -Zc: referenceBinding -Zi -MDd -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 - wd4577 -wd4467 -EHsc /Fddebug\VTK.vc.pdb -DUNICODE -D_UNICODE -DWIN32 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DWIN64 -DQT_DEPRECATED_WARNINGS -DQT_QML_BW_BID_IBWDIBIDIBDIBDIBDIBIDIBDIBDIBWIB -IC: \ apps \ MSVC_apps_debug \ VTK_820 \ include \ vtk-8.2 -IC: \ Qt \ 5.12.6 \ msvc2017_64 \ include -IC: \ Qt \ 5.12.6 \ msvc2017_64 \ include \ QtWidgets -IC: \ Qt \ 5.12 .6 \ msvc2017_64 \ include \ QtGui -IC: \ Qt \ 5.12.6 \ msvc2017_64 \ include \ QtANGLE -IC: \ Qt \ 5.12.6 \ msvc2017_64 \ include \ QtCore -Idebug -I. -I / include -IC: \ Qt \ 5.12.6 \ msvc2017_64 \ mkspecs \ win32-msvc -Fodebug \ @C: \ Users \ tasik \ AppData \ Local \ Temp \ main.obj.3864.32.jom
                                      cl -BxC: \ Qt \ 5.12.6 \ msvc2017_64 \ bin \ qmake.exe -nologo -Zc: wchar_t -FS -Zc: rvalueCast -Zc: inline -Zc: strictStrings -Zc: throwingNew -Zc: referenceBinding -Zi -MDd -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -EC: \ Qt \ 5.12.6 \ msvc2017_64 \ mkspecs \ features \ data \ dummy.cpp 2> NUL> debug \ moc_predefs.h
                                      cl -c -nologo -Zc: wchar_t -FS -Zc: rvalueCast -Zc: inline -Zc: strictStrings -Zc: throwingNew -Zc: referenceBinding -Zi -MDd -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 - wd4577 -wd4467 -EHsc /Fddebug\VTK.vc.pdb -DUNICODE -D_UNICODE -DWIN32 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DWIN64 -DQT_DEPRECATED_WARNINGS -DQT_QML_BW_BID_IBWDIBIDIBDIBDIBDIBIDIBDIBDIBWIB -IC: \ apps \ MSVC_apps_debug \ VTK_820 \ include \ vtk-8.2 -IC: \ Qt \ 5.12.6 \ msvc2017_64 \ include -IC: \ Qt \ 5.12.6 \ msvc2017_64 \ include \ QtWidgets -IC: \ Qt \ 5.12 .6 \ msvc2017_64 \ include \ QtGui -IC: \ Qt \ 5.12.6 \ msvc2017_64 \ include \ QtANGLE -IC: \ Qt \ 5.12.6 \ msvc2017_64 \ include \ QtCore -Idebug -I. -I / include -IC: \ Qt \ 5.12.6 \ msvc2017_64 \ mkspecs \ win32-msvc -Fodebug \ @C: \ Users \ tasik \ AppData \ Local \ Temp \ mainwindow.obj.3864.110.jom
                                      main.cpp
                                      mainwindow.cpp
                                      C: \ Qt \ 5.12.6 \ msvc2017_64 \ bin \ moc.exe -DUNICODE -D_UNICODE -DWIN32 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DWIN64 -DQT_DEPRECATED_WARNINGS -DQT_LIBD_LIBD_LIB_DIBT_LIB_LIB_LIB_LIB_LIBE_LIB_LIB_LIB_DIT_LIB_LIB_DIT_LIB_DIT_LIBE_LINE /tasik/Documents/Qt_Projects/build-VTK-Desktop_Qt_5_12_6_MSVC2017_64_bit-Debug/debug/moc_predefs.h -IC: /Qt/5.12.6/msvc2017_64/mkspecs/win32-msvc -IC_Projects / ICKms / VTs / ICsProcs / ICsProcs / ICs -IC: /apps/MSVC_apps_debug/VTK_820/include/vtk-8.2 -IC: /Qt/5.12.6/msvc2017_64/include -IC: /Qt/5.12.6/msvc2017_64/include/QtWidgets -IC: /Qt/5.12 .6 / msvc2017_64 / include / QtGui -IC: /Qt/5.12.6/msvc2017_64/include/QtANGLE -IC: /Qt/5.12.6/msvc2017_64/include/QtCore -I. -I "C: \ Program Files (x86) \ Microsoft Visual Studio \ 2017 \ Community \ VC \ Tools \ MSVC \ 10/14/25017 \ ATLMFC \ include" -I "C: \ Program Files (x86) \ Microsoft Visual Studio \ 2017 \ Community \ VC \ Tools \ MSVC \ 10.14.25017 \ include "-I" C: \ Program Files (x86) \ Windows Kits \ NETFXSDK \ 4.6.1 \ include \ um "-I" C: \ Program Files ( x86) \ Windows Kits \ 10 \ include \ 10.0.18362.0 \ ucrt "-I" C: \ Program Files (x86) \ Windows Kits \ 10 \ include \ 10.0.18362.0 \ shared "-I" C: \ Program Files ( x86) \ Windows Kits \ 10 \ include \ 10.0.18362.0 \ um "-I" C: \ Program Files (x86) \ Windows Kits \ 10 \ include \ 10.0.18362.0 \ winrt ".. \ VTK \ mainwindow.h - o debug \ moc_mainwindow.cpp
                                      cl -c -nologo -Zc: wchar_t -FS -Zc: rvalueCast -Zc: inline -Zc: strictStrings -Zc: throwingNew -Zc: referenceBinding -Zi -MDd -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 - wd4577 -wd4467 -EHsc /Fddebug\VTK.vc.pdb -DUNICODE -D_UNICODE -DWIN32 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DWIN64 -DQT_DEPRECATED_WARNINGS -DQT_QML_BW_BID_IBWDIBIDIBDIBDIBDIBIDIBDIBDIBWIB -IC: \ apps \ MSVC_apps_debug \ VTK_820 \ include \ vtk-8.2 -IC: \ Qt \ 5.12.6 \ msvc2017_64 \ include -IC: \ Qt \ 5.12.6 \ msvc2017_64 \ include \ QtWidgets -IC: \ Qt \ 5.12 .6 \ msvc2017_64 \ include \ QtGui -IC: \ Qt \ 5.12.6 \ msvc2017_64 \ include \ QtANGLE -IC: \ Qt \ 5.12.6 \ msvc2017_64 \ include \ QtCore -Idebug -I. -I / include -IC: \ Qt \ 5.12.6 \ msvc2017_64 \ mkspecs \ win32-msvc -Fodebug \ @C: \ Users \ tasik \ AppData \ Local \ Temp \ moc_mainwindow.obj.3864.1672.jom
                                      moc_mainwindow.cpp
                                      link / NOLOGO / DYNAMICBASE / NXCOMPAT / DEBUG / SUBSYSTEM: WINDOWS "/ MANIFESTDEPENDENCY: type = 'win32' name = 'Microsoft.Windows.Common-Controls' version =' 6.0.0.0 'publicKeyToken =' 6595b64144ccf1df 'language =' * '' processorArchitecture = '*' "/ MANIFEST: embed /OUT:debug\VTK.exe @C: \ Users \ tasik \ AppData \ Local \ Temp \ VTK.exe.3864.6172.jom
                                      03:48:52: The process "C: \ Qt \ Tools \ qtcreator-4.11.0 \ bin \ jom.exe" completed successfully.
                                      03:48:52: Elapsed time: 00:07.
                                      

                                      Everything is well but suddenly I get a window with text "CDB process ended"

                                      If I run in release mode then QMAKE tells me the same jom 1.1.3 - empower your cores and when running the project compiler tells me something similar as in debug mode but application output:

                                      03:54:39: C: \ Users \ tasik \ Documents \ Qt_Projects \ build-VTK-Desktop_Qt_5_12_6_MSVC2017_64_bit-Release \ release \ VTK.exe starts ...
                                      03:54:39: The program ended unexpectedly.
                                      03:54:39: The process was completed forcibly.
                                      03:54:39: C: \ Users \ tasik \ Documents \ Qt_Projects \ build-VTK-Desktop_Qt_5_12_6_MSVC2017_64_bit-Release \ release \ VTK.exe failed.
                                      

                                      Seems to me that something stops my application... I already turned off Fault Tolerant Heap but that didn't help.
                                      Here is my kit:kit.png

                                      1 Reply Last reply
                                      0
                                      • P Offline
                                        P Offline
                                        Please_Help_me_D
                                        wrote on 1 Jan 2020, 01:14 last edited by
                                        #30

                                        And happy New Year!
                                        Sorry but I can't leave my project even at such holiday :D

                                        1 Reply Last reply
                                        0
                                        • S Offline
                                          S Offline
                                          SGaist
                                          Lifetime Qt Champion
                                          wrote on 1 Jan 2020, 07:42 last edited by
                                          #31

                                          Happy new year !

                                          Did you change any dependency ?
                                          VTK version ?
                                          Application name ?

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

                                          P 1 Reply Last reply 1 Jan 2020, 11:27
                                          1

                                          • Login

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