Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. Qt Contribution
  4. can't debug hand-built Qt Frameworks
QtWS25 Last Chance

can't debug hand-built Qt Frameworks

Scheduled Pinned Locked Moved Unsolved Qt Contribution
32 Posts 2 Posters 5.1k 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.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #8
    1. literally what it says: build in a folder outside of the source tree.
    2. there are various reasons: build Qt with a different set of options, build a reduced version of Qt with features disabled to lower its footprint, etc. So yes you can keep the developer build option
    3. no do not use the prefix flag. As already said it creates an in-place build so you do not need to call make install after each build.
    4. no they are not. The developer build also enables some additional flags (sorry I don't have them on the top of my head) that makes the build less optimized than a usual release build. When you release an application use a proper release build for that.

    One additional thing: build only what you really need and skip webengine in any case unless you have to.

    There's no sense in building everything if you are only going to hack on qtbase. You will just waste time, space and electricity.

    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
    • D Offline
      D Offline
      davecotter
      wrote on last edited by
      #9

      1: to build in a folder outside of the source tree, doesn't that mean using -prefix? or does it just mean set the current working directory to the location you want the build artifacts, and invoke "make" from that location?
      2: okay, so keep the -developer-build option
      3: see 1
      4: so how do i create this "proper release build" that has the changes i've made to the Qt source? to be clear: i want to create both debug and release builds of Qt, and deploy my app WITH the release builds that i've built
      5: does macdeployqt magically do the right thing?
      6: by "build only what you really need" do you mean build only the modules that i have specified in my qmake file at the top? eg: if my .pro file has this line:

      QT += core gui sql widgets multimedia multimediawidgets
      

      does that mean i only need to build those modules?

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by SGaist
        #10
        1. no, prefix is for the installation of the build result.

        Snip

        1. make a standard non developer build once you are satisfied with the changes you did with Qt.

        2. there's nothing macdeployqt can do beside deploying the frameworks that were used to build your application. It's a helper tool that uses standard commands to create the dmg. So deploying your application with a developer build of Qt is not recommended.

        3. with that list you need to build qtbase and qtmultimedia. Note that having only these two will disable the qml support in qtmultimedia.

        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
        • D Offline
          D Offline
          davecotter
          wrote on last edited by
          #11

          so, to recap, i need to do these commands:

          > cd <path_to>/Qt5_Source/build
          > ../qt5/configure -developer-build -debug-and-release -opensource -nomake examples -nomake tests -confirm-license -feature qtbase -feature qtmultimedia
          > make
          > ../qt5/configure -prefix ./release -opensource -nomake examples -nomake tests -confirm-license -feature qtbase -feature qtmultimedia
          > make
          > make install
          
          1. is that all correct?
          2. and after that i can build either debug or release version of my app and it should work?
          3. and i can debug into the source of Qt?
          4. and when i run macdeployqt, it will use my built version of Qt?
          5. do i need to specify anything extra on the command line for macdeployqt?
          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #12
            1. no use two different build folder
            2. it should
            3. you should be able to
            4. yes, note that you may need to build the qttools module or macdeployqt directly from it. But you should be able to use the one from your pre-built installation.
            5. that depends on how you want to distribute your application. You should sign it and possibly notarize 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
            • D Offline
              D Offline
              davecotter
              wrote on last edited by davecotter
              #13
              1. do you mean this:
              > cd <path_to>/Qt5_Source/build
              > ../qt5/configure -prefix ./debug -developer-build -debug-and-release -opensource -nomake examples -nomake tests -confirm-license -feature qtbase -feature qtmultimedia
              > make
              > ../qt5/configure -prefix ./release -opensource -nomake examples -nomake tests -confirm-license -feature qtbase -feature qtmultimedia
              > make
              

              if you don't mean that can you please just spell out exactly what you mean?
              4) do you mean this:

              ../qt5/configure -prefix ./release -opensource -nomake examples -nomake tests -confirm-license -feature qtbase -feature qtmultimedia -feature qttools
              

              if not can you spell out what you mean?
              5) yes i only have macdeployqt do the linking / signing / hardening. i already have a post process that builds a dmg and notarizes. i was only asking if i need something extra on the macdeployqt command line to get it to use MY copies of the built binaries for Qt

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by SGaist
                #14
                1. I mean: use two different folders for your out of source builds. You do not want it mix the build artifacts of your developer build and your release build.

                Snip

                1. If memory serves well, macdeployqt will use the information from the frameworks linked in your application to get the Qt frameworks to be copied into the app bundle.

                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
                • D Offline
                  D Offline
                  davecotter
                  wrote on last edited by davecotter
                  #15
                  1. do you mean this:
                  > cd <path_to>/Qt5_Source/build/debug
                  > ../../qt5/configure -developer-build -debug-and-release -opensource -nomake examples -nomake tests -confirm-license -feature qtbase -feature qtmultimedia
                  > make
                  > cd <path_to>/Qt5_Source/build/release
                  > ../../qt5/configure -prefix ./obj -opensource -nomake examples -nomake tests -confirm-license -feature qtbase -feature qtmultimedia
                  > make
                  > make install
                  
                  1. what about 4. above?
                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #16

                    You should use more meaningful names for your folders. Your developer build is not just a debug build.
                    Using obj as prefix is really strange considering that this folder is going to contain a full Qt installation.

                    I missed that you used "feature". This a different thing. You do not need it right now. Currently you want to use the "-skip" parameter to avoid building certain qtXXX modules.

                    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
                    • D Offline
                      D Offline
                      davecotter
                      wrote on last edited by
                      #17

                      believe me when i say i very much appreciate your bearing with me and continuing to answer my questions, but it's also true that you're assuming i have a lot of knowledge that you have, that i definitely don't have.

                      can you please spell out EXACTLY what the command lines should be for me to build both debug and release, and please include what you mean by "more meaningful names" because i do NOT know what you have in mind.

                      please would you be willing to just type up the command lines that you would use to do what i am trying to do, cuz i do not know what you mean. thanks...

                      1 Reply Last reply
                      0
                      • D Offline
                        D Offline
                        davecotter
                        wrote on last edited by davecotter
                        #18

                        perhaps i can be more clear in my question.

                        1. what would you recommend for "meaningful names" ?
                        2. what name would you recommend in place of where i used "obj" ?
                        3. instead of using "feature" to include only the features i want, you suggest using "skip" to skip the features i do not want. how do i get a list of features that can go into "skip", and how do i know which ones i want to include on the "skip" line?
                        1 Reply Last reply
                        0
                        • D Offline
                          D Offline
                          davecotter
                          wrote on last edited by
                          #19

                          pretty please? with <insert favorite indulgence> on top?

                          1 Reply Last reply
                          0
                          • SGaistS Offline
                            SGaistS Offline
                            SGaist
                            Lifetime Qt Champion
                            wrote on last edited by SGaist
                            #20
                            1. use the Qt version in the name of folder. for example Qt_5_15_2_devel_build
                            2. at least the Qt version as above.
                            3. you are mixing modules and features. These are separate concepts. Skip everything you do not want to build.

                            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
                            • D Offline
                              D Offline
                              davecotter
                              wrote on last edited by davecotter
                              #21

                              while i reiterate that i am very grateful for your continuing to try to help, i still would more appreciate explicit instructions, rather than hints.

                              i understand the socratic method, to answer a question with a question, to make me think, to hope to teach, to leave some to the student to try to figure out. sure. that has its place. but i think we could (i could) get a lot more done in a day if you could help by giving a concrete example. also you wouldn't have to keep coming back and giving me more hints. :) save us both some time.

                              so... i did take your hints and i've run as far as i can with them. i've tried to make MY directory layout look just like the one that comes with Qt Creator. My new commands are this:

                              > cd <path_to>/Qt5_Source
                              > git clone git://code.qt.io/qt/qt5.git
                              > mv ./qt5 ./Src
                              > cd Src
                              > git checkout 5.15.2
                              > perl init-repository --module-subset=default,-qtwebchannel,-qtwebengine,-qtwebglplugin,-qtwebsockets,-qtwebview,-qt3d,-qtcharts,-qtquick3d,-qtquickcontrols,-qtquickcontrols2,-qtquicktimeline
                              > cd ..
                              > mkdir build
                              > cd build
                              > ../Src/configure -prefix ../clang_64 -force-debug-info -debug-and-release -opensource -nomake examples -nomake tests -confirm-license
                              > make -j12
                              > make install
                              

                              so, even though i did -force-debug-info and -debug-and-release, the .../Qt5_Source/clang_64/lib directory still does NOT contain any debug info files (.dSYM).

                              so my original question still is posed: how do i debug these guys?

                              again i BEG you: if any of my commands above are WRONG, please provide CORRECTED examples, not hints. as you can see, i'm NOT GOOD at deciphering hints, i much prefer instructions.

                              note that an end goal will be to have "qt.pro" (or whatever the right project(s) are) as a depencency of my own project, such that, in Qt Creator, i can edit code in any of the Qt Frameworks, and just hit run, and it will compile and stage the Qt stuff, then compile and link my project to that, and run my project.

                              thanks so much!

                              -dave

                              ps: unfortunately, also this happened after make install assembled a lot of stuff into bin:

                              cd qhelpgenerator/ && ( test -e Makefile || /Volumes/Developer/depot/Qt5_Source/build/qtbase/bin/qmake -o Makefile /Volumes/Developer/depot/Qt5_Source/Src/qttools/src/assistant/qhelpgenerator/qhelpgenerator.pro ) && /Applications/Xcode_10.3.app/Contents/Developer/usr/bin/make -f Makefile install
                              
                              make[4]: *** No rule to make target `install'.  Stop.
                              make[3]: *** [sub-qhelpgenerator-install_subtargets] Error 2
                              make[2]: *** [sub-assistant-install_subtargets] Error 2
                              make[1]: *** [sub-src-install_subtargets] Error 2
                              make: *** [module-qttools-install_subtargets] Error 2
                              
                              1 Reply Last reply
                              0
                              • D Offline
                                D Offline
                                davecotter
                                wrote on last edited by
                                #22

                                okay, so after some more testing i see that i CAN in fact, now debug, and set breakpoints within the Qt code base. This is true even though i do not see any ".dSYM" files.

                                so this question is answered. thanks so much for your help. :D

                                not sure why QHelpGenerator failed to build, or what the consequences are, if any. if you have any ideas on that please let me know.

                                (also i apologize if helping me was frustrating, i'm doing my best and sometimes i have a hard time understanding stuff. but seems i got it in the end.)

                                1 Reply Last reply
                                0
                                • SGaistS Offline
                                  SGaistS Offline
                                  SGaist
                                  Lifetime Qt Champion
                                  wrote on last edited by
                                  #23

                                  AFAIR (but might be wrong), the .dSYM file are generated when you do a "release with debug symbol" build.

                                  I do not know for QHelpGenerator, the failure source is upper in the build log.

                                  Glad you can debug as you wish :-)

                                  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
                                  • D Offline
                                    D Offline
                                    davecotter
                                    wrote on last edited by
                                    #24

                                    and how does one do a "release with debug symbols" build?

                                    1 Reply Last reply
                                    0
                                    • SGaistS Offline
                                      SGaistS Offline
                                      SGaist
                                      Lifetime Qt Champion
                                      wrote on last edited by
                                      #25

                                      If memory serves well, something like "-release -force-debug-info".

                                      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
                                      • D Offline
                                        D Offline
                                        davecotter
                                        wrote on last edited by
                                        #26

                                        if i do -release does that mean i do NOT do -debug-and-release? ie: are they mutually exclusive?

                                        1 Reply Last reply
                                        0
                                        • SGaistS Offline
                                          SGaistS Offline
                                          SGaist
                                          Lifetime Qt Champion
                                          wrote on last edited by
                                          #27

                                          I do not remember which one takes precedents over the other. You can try to mix debug-and-release with force-bebug-info.

                                          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

                                          • Login

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