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. Project tree changes when switching from debug to release mode
QtWS25 Last Chance

Project tree changes when switching from debug to release mode

Scheduled Pinned Locked Moved Solved General and Desktop
8 Posts 3 Posters 566 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.
  • D Offline
    D Offline
    davidesalvetti
    wrote on last edited by
    #1

    Hi,

    I'm getting a strange behavior that I've never seen before on the project tree. I'm using MacOs 10.13.6 and Qt 5.12.2 clang64 and I want to start my program in release mode, but I get an error while compiling:
    Schermata 2020-01-20 alle 10.10.04.png

    In debug mode I never get this error and the function used by the helper.js file that is missing are working properly. So I looked at the project view to be sure the file was included in the Project Tree and I found this difference between debug and release mode:
    Release mode:
    Schermata 2020-01-20 alle 10.03.42.png
    Debug mode:
    Schermata 2020-01-20 alle 10.03.28.png

    So I suppose that the error is due to this behavior, am I right? But why does the project tree change when switching between debug and release mode? How can I avoid this? Or do I have to specify the differences in the path in some way?

    Thanks in advance!

    jsulmJ 1 Reply Last reply
    0
    • D Offline
      D Offline
      davidesalvetti
      wrote on last edited by
      #8

      After a lot of attempts I manage to build my project in release mode using a workaround, but I don't really know if it's something safe.

      In build settings->Release I disabled the flag "Enable Qt Quick Compiler" since it's disabled also in release mode.

      From what I can see the application is working correctly and is not giving me any problem.

      1 Reply Last reply
      0
      • D davidesalvetti

        Hi,

        I'm getting a strange behavior that I've never seen before on the project tree. I'm using MacOs 10.13.6 and Qt 5.12.2 clang64 and I want to start my program in release mode, but I get an error while compiling:
        Schermata 2020-01-20 alle 10.10.04.png

        In debug mode I never get this error and the function used by the helper.js file that is missing are working properly. So I looked at the project view to be sure the file was included in the Project Tree and I found this difference between debug and release mode:
        Release mode:
        Schermata 2020-01-20 alle 10.03.42.png
        Debug mode:
        Schermata 2020-01-20 alle 10.03.28.png

        So I suppose that the error is due to this behavior, am I right? But why does the project tree change when switching between debug and release mode? How can I avoid this? Or do I have to specify the differences in the path in some way?

        Thanks in advance!

        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #2

        @davidesalvetti Did you try a complete clean rebuild after switching to Debug mode? Delete build directory, run qmake and then build.

        D 1 Reply Last reply
        0
        • jsulmJ jsulm

          @davidesalvetti Did you try a complete clean rebuild after switching to Debug mode? Delete build directory, run qmake and then build.

          D Offline
          D Offline
          davidesalvetti
          wrote on last edited by davidesalvetti
          #3

          @jsulm Thanks for your answer. I try to do exactly what you said, but the build step still generates that error and the project tree still changes when switching between the two mode.

          This is my Graphs.pri file:

          INCLUDEPATH += $$PWD
          
          SOURCES += \
              $$PWD/allarmpannel.cpp \
              $$PWD/colorrange.cpp \
              $$PWD/insertintermediates.cpp \
              $$PWD/qchartviewer.cpp \
              $$PWD/chartsaxis.cpp \
              $$PWD/chartsettings.cpp \
              $$PWD/addchannel.cpp \
              $$PWD/baseviewport.cpp
              $$PWD/stackedalarmpanel.cpp \
              $$PWD/chartzoom.cpp \
              $$PWD/tablewidget.cpp 
          
          HEADERS += \
              $$PWD/allarmpannel.h \
              $$PWD/colorrange.h \
              $$PWD/insertintermediates.h \
              $$PWD/qchartviewer.h \
              $$PWD/chartsaxis.h \
              $$PWD/chartsettings.h \
              $$PWD/addchannel.h \
              $$PWD/baseviewport.h \
              $$PWD/stackedalarmpanel.h \
              $$PWD/chartzoom.h \
              $$PWD/tablewidget.h 
          
          FORMS += \
              $$PWD/allarmpannel.ui \
              $$PWD/colorrange.ui \
              $$PWD/insertintermediates.ui \
              $$PWD/chartsaxis.ui \
              $$PWD/chartsettings.ui \
              $$PWD/addchannel.ui \
              $$PWD/baseviewport.ui \
              $$PWD/stackedalarmpanel.ui \
              $$PWD/chartzoom.ui 
          
          RESOURCES += \
              $$PWD/qmlmap.qrc
          
          

          and in the qmlmap.qrc there is the helper.js that gives the error.

          In my .pro file the Graphs.pri is included as following:

          include(Graphs/Graphs.pri)
          

          I never got problems like this on windows, It's the first time they came up.

          I forget to mention that the file "helper.js" is used in a qml file called Map.qml inside the resources and it's imported into the file like this:

          import "helper.js" as Helper
          

          In debug mode the project tree of the Resource inside the Grapth.pri is the following:
          Schermata 2020-01-20 alle 15.58.31.png

          while in release mode the Resource folder of Graph.pri disappears and I've just seen that appears in the sources folder:
          Schermata 2020-01-20 alle 16.02.08.png

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

            Hi,

            Can you try build from the command line directly ?

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

            D 1 Reply Last reply
            0
            • SGaistS SGaist

              Hi,

              Can you try build from the command line directly ?

              D Offline
              D Offline
              davidesalvetti
              wrote on last edited by
              #5

              @SGaist yes of course. I deleted the release folder and on the command line I have executed the following commands:

              Schermata 2020-01-21 alle 09.34.02.png

              It has just created the release folder and the makefile but no .app file or something else, but it doesn't give any error. That's strange, what am I missing?

              My start directory on the command line is : /Users/developer/Qt/5.12.2/clang_64/bin just to be clear.

              Thanks again.

              jsulmJ 1 Reply Last reply
              0
              • D davidesalvetti

                @SGaist yes of course. I deleted the release folder and on the command line I have executed the following commands:

                Schermata 2020-01-21 alle 09.34.02.png

                It has just created the release folder and the makefile but no .app file or something else, but it doesn't give any error. That's strange, what am I missing?

                My start directory on the command line is : /Users/developer/Qt/5.12.2/clang_64/bin just to be clear.

                Thanks again.

                jsulmJ Offline
                jsulmJ Offline
                jsulm
                Lifetime Qt Champion
                wrote on last edited by
                #6
                This post is deleted!
                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #7

                  Two things I can see:

                  • you just configured your project to build in the folder containing qmake
                  • it's make -C when you want to call make on a specific folder.

                  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
                  2
                  • D Offline
                    D Offline
                    davidesalvetti
                    wrote on last edited by
                    #8

                    After a lot of attempts I manage to build my project in release mode using a workaround, but I don't really know if it's something safe.

                    In build settings->Release I disabled the flag "Enable Qt Quick Compiler" since it's disabled also in release mode.

                    From what I can see the application is working correctly and is not giving me any problem.

                    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