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. Impossible Generate Executable whit its dependecy
Forum Updated to NodeBB v4.3 + New Features

Impossible Generate Executable whit its dependecy

Scheduled Pinned Locked Moved Solved General and Desktop
22 Posts 6 Posters 792 Views 2 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.
  • A Offline
    A Offline
    AntGP
    wrote last edited by
    #1

    Hello,

    I'm currently trying to generate the executable of my project, but I have some issues.
    I don't know how to change the executable location during the build.

    I'm working on a very strange project that has multiple .pro files that are built into multiples .exe

    When I try to move the build folder, it does move some files, mostly the moc_(...).cpp file, but I don't generate any exe files that I selected. Instead, it generates in a "bin" folder in the same folder as the .pro

    Additionally, I don't know if it's usual, but there is something like 18 .pro files, calling each other, and it looks like someone who really over engineering what he wanted to do.

    I don't even know how to explain the issue or what to exactly ask, because all tutorial just have to select a folder on the project configuration and it work, but not for me...

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

      Hi,

      While 18 is large, it's not completely extraordinary (just take the Qt5 sources for an example of large qmake based project).

      However .pro files calling each other does not sound right. For "multi-projects" project, there is the subdirs template. I think you should check that as a starting point.

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

      A 2 Replies Last reply
      1
      • SGaistS SGaist

        Hi,

        While 18 is large, it's not completely extraordinary (just take the Qt5 sources for an example of large qmake based project).

        However .pro files calling each other does not sound right. For "multi-projects" project, there is the subdirs template. I think you should check that as a starting point.

        A Offline
        A Offline
        AntGP
        wrote last edited by AntGP
        #3

        @SGaist
        I'm clearly not an expert on the subject, but I think the documentation you gave can help me.

        Looking at it i'v managed to understand a bit what was done across the different .pro
        And i noticed that every single one had :
        Include(common.pro) ??
        TEMPLATE = subdirs like the exemples on the wiki

        And looking at that common i don't really know what it mean.

        #DEFINES += NO_GRAPHVIZ
        
        INCLUDEPATH+=$$PWD
        #DEPENDPATH += $$PWD
        #include($$PWD/config/config.pri)
        
        DESTDIR = $$PWD/bin
        ROOTDIR = $$PWD
        OBJECTS_DIR = $$ROOTDIR/objects/$$TARGET
        INCLUDEPATH +=$$ROOTDIR/../boost/
        
        unix:INCLUDEPATH+=/usr/include/graphviz
        
        CONFIG += c++11
        
        QT       += core widgets gui svg
        LIBS += -Wl,--start-group
        
        for(dep, DEPENDENCY_LIBRARIES) {
        
            LIBS += -L$$ROOTDIR/lib/ -l$${dep}
            PRE_TARGETDEPS += $$ROOTDIR/lib/lib$${dep}.a
        }
        
        LIBS += -Wl,--end-group
        QMAKE_CXXFLAGS += -Wno-unused-local-typedefs
        
        

        I have the impression it's ovewriting every configuration I try to make to generate an executable by redirecting everithing to the bin folder on the same path as it self

        And it don't generate any dll and generate copy all the source code under the name moc_xxx.cpp ... i'm really stuck

        ps: the .pro file i use to build and execute my project

        #-------------------------------------------------
        #
        # Project created by QtCreator 2013-06-28T11:05:37
        #
        #-------------------------------------------------
        include(common.pro)
        TEMPLATE = subdirs
        CONFIG += ordered
        SUBDIRS += models
        
        SUBDIRS += controllers
        SUBDIRS += undo
        
        SUBDIRS += utils
        SUBDIRS += addons
        SUBDIRS += config
        SUBDIRS += cppViews
        
        #SUBDIRS += modelsTest
        #SUBDIRS += undoTest
        SUBDIRS += application
        
        jsulmJ 1 Reply Last reply
        0
        • A AntGP

          @SGaist
          I'm clearly not an expert on the subject, but I think the documentation you gave can help me.

          Looking at it i'v managed to understand a bit what was done across the different .pro
          And i noticed that every single one had :
          Include(common.pro) ??
          TEMPLATE = subdirs like the exemples on the wiki

          And looking at that common i don't really know what it mean.

          #DEFINES += NO_GRAPHVIZ
          
          INCLUDEPATH+=$$PWD
          #DEPENDPATH += $$PWD
          #include($$PWD/config/config.pri)
          
          DESTDIR = $$PWD/bin
          ROOTDIR = $$PWD
          OBJECTS_DIR = $$ROOTDIR/objects/$$TARGET
          INCLUDEPATH +=$$ROOTDIR/../boost/
          
          unix:INCLUDEPATH+=/usr/include/graphviz
          
          CONFIG += c++11
          
          QT       += core widgets gui svg
          LIBS += -Wl,--start-group
          
          for(dep, DEPENDENCY_LIBRARIES) {
          
              LIBS += -L$$ROOTDIR/lib/ -l$${dep}
              PRE_TARGETDEPS += $$ROOTDIR/lib/lib$${dep}.a
          }
          
          LIBS += -Wl,--end-group
          QMAKE_CXXFLAGS += -Wno-unused-local-typedefs
          
          

          I have the impression it's ovewriting every configuration I try to make to generate an executable by redirecting everithing to the bin folder on the same path as it self

          And it don't generate any dll and generate copy all the source code under the name moc_xxx.cpp ... i'm really stuck

          ps: the .pro file i use to build and execute my project

          #-------------------------------------------------
          #
          # Project created by QtCreator 2013-06-28T11:05:37
          #
          #-------------------------------------------------
          include(common.pro)
          TEMPLATE = subdirs
          CONFIG += ordered
          SUBDIRS += models
          
          SUBDIRS += controllers
          SUBDIRS += undo
          
          SUBDIRS += utils
          SUBDIRS += addons
          SUBDIRS += config
          SUBDIRS += cppViews
          
          #SUBDIRS += modelsTest
          #SUBDIRS += undoTest
          SUBDIRS += application
          
          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote last edited by
          #4

          @AntGP Did you run qmake in a clean build folder? What happens exactly when you build? Any warnings/errors?

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

          1 Reply Last reply
          0
          • A Offline
            A Offline
            AntGP
            wrote last edited by AntGP
            #5

            Qmake is via a terminal ? I run MiniGW, and even when i try to run it on a clean foler it got build on the same folder

            Some files are generated on the folder i selected, like some makefiles and qmake.stash, but nothing else, and everithing is in the midle of the source code

            I'm not the one who made that, it's somthing from 2013 and no one is still around to explain how they managed to generate a working executable

            jsulmJ 1 Reply Last reply
            0
            • A AntGP

              Qmake is via a terminal ? I run MiniGW, and even when i try to run it on a clean foler it got build on the same folder

              Some files are generated on the folder i selected, like some makefiles and qmake.stash, but nothing else, and everithing is in the midle of the source code

              I'm not the one who made that, it's somthing from 2013 and no one is still around to explain how they managed to generate a working executable

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote last edited by
              #6

              @AntGP said in Impossible Generate Executable whit its dependecy:

              everithing is in the midle of the source code

              Where is your build folder?
              After calling qmake you need to start the actual build (by calling make for example).

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

              1 Reply Last reply
              0
              • A Offline
                A Offline
                AntGP
                wrote last edited by AntGP
                #7

                image.png
                the build folder is in the midle of all other folder. i'v highlighted the source code folders
                and i build using thoose buttons on Qt creator :

                image.png

                And whatever i change in the project tab, it allways build here, not on the folder i select

                jsulmJ Pl45m4P 2 Replies Last reply
                0
                • A AntGP

                  image.png
                  the build folder is in the midle of all other folder. i'v highlighted the source code folders
                  and i build using thoose buttons on Qt creator :

                  image.png

                  And whatever i change in the project tab, it allways build here, not on the folder i select

                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote last edited by
                  #8

                  @AntGP QtCreator sets the build folder, check what is set there

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

                  1 Reply Last reply
                  0
                  • A Offline
                    A Offline
                    AntGP
                    wrote last edited by
                    #9

                    image.png
                    by default it set on the project folder

                    image.png
                    But when i try to change the folder it put a warning message and then change nothing

                    jsulmJ 1 Reply Last reply
                    0
                    • A AntGP

                      image.png
                      the build folder is in the midle of all other folder. i'v highlighted the source code folders
                      and i build using thoose buttons on Qt creator :

                      image.png

                      And whatever i change in the project tab, it allways build here, not on the folder i select

                      Pl45m4P Offline
                      Pl45m4P Offline
                      Pl45m4
                      wrote last edited by
                      #10

                      @AntGP said in Impossible Generate Executable whit its dependecy:

                      and i build using thoose buttons on Qt creator

                      Sorry have to say, this answer is... something... creative :D

                      @AntGP Don't worry about the structure or the multiple *.pro files. It's common for larger projects with submodules, which need some extra build/install configuration...
                      The include includes other .pro files, so you can share variables and functions/macros. That's why there is a common.pro which is included in (almost) every other pro (-ject).

                      @AntGP said in Impossible Generate Executable whit its dependecy:

                      I'm working on a very strange project that has multiple .pro files that are built into multiples .exe

                      There is nothing strange about that. Having projects with more than one executable and multiple libraries is also standard.
                      What does this whole thing do? What kind of project is it?
                      What is your goal?! Just building it? Because I see you commented some of the submodules in the .pro file, so they are not included?!


                      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

                      ~E. W. Dijkstra

                      A 1 Reply Last reply
                      1
                      • A AntGP

                        image.png
                        by default it set on the project folder

                        image.png
                        But when i try to change the folder it put a warning message and then change nothing

                        jsulmJ Offline
                        jsulmJ Offline
                        jsulm
                        Lifetime Qt Champion
                        wrote last edited by
                        #11

                        @AntGP said in Impossible Generate Executable whit its dependecy:

                        But when i try to change the folder it put a warning message and then change nothing

                        That's because QtCreator expects the build folder to be outside the source tree. Any reason why you want to have the build folder inside the tree folder?

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

                        1 Reply Last reply
                        0
                        • Pl45m4P Pl45m4

                          @AntGP said in Impossible Generate Executable whit its dependecy:

                          and i build using thoose buttons on Qt creator

                          Sorry have to say, this answer is... something... creative :D

                          @AntGP Don't worry about the structure or the multiple *.pro files. It's common for larger projects with submodules, which need some extra build/install configuration...
                          The include includes other .pro files, so you can share variables and functions/macros. That's why there is a common.pro which is included in (almost) every other pro (-ject).

                          @AntGP said in Impossible Generate Executable whit its dependecy:

                          I'm working on a very strange project that has multiple .pro files that are built into multiples .exe

                          There is nothing strange about that. Having projects with more than one executable and multiple libraries is also standard.
                          What does this whole thing do? What kind of project is it?
                          What is your goal?! Just building it? Because I see you commented some of the submodules in the .pro file, so they are not included?!

                          A Offline
                          A Offline
                          AntGP
                          wrote last edited by AntGP
                          #12

                          @Pl45m4 said in Impossible Generate Executable whit its dependecy:

                          What does this whole thing do?

                          My goals are to have the executable able to work whiout all the source code, i don't want any .cpp allongside the exe so i can share the programme, and not have 1Go of source code with it

                          @Pl45m4 said in Impossible Generate Executable whit its dependecy:

                          There is nothing strange about that.
                          It's a 15 years old project whit no documentation, no comments on the code, lot of java script, and at least 4 differents dev befor me
                          It can be built, but not outside of the source code folder

                          @jsulm said in Impossible Generate Executable whit its dependecy:

                          That's because QtCreator expects the build folder to be outside the source tree. Any reason why you want to have the build folder inside the tree folder?

                          That what i'm trying to do, i want to build it on my desktop and not on my source tree, but it build on the source tree even if i don't want and say otherwise, and if i try to move the .exe it say it miss some dll that are not even on the project or anywhere on my computer

                          (i think the name of the topic is not the best one whit some insight on the issues i have now)

                          Pl45m4P 1 Reply Last reply
                          0
                          • A AntGP

                            @Pl45m4 said in Impossible Generate Executable whit its dependecy:

                            What does this whole thing do?

                            My goals are to have the executable able to work whiout all the source code, i don't want any .cpp allongside the exe so i can share the programme, and not have 1Go of source code with it

                            @Pl45m4 said in Impossible Generate Executable whit its dependecy:

                            There is nothing strange about that.
                            It's a 15 years old project whit no documentation, no comments on the code, lot of java script, and at least 4 differents dev befor me
                            It can be built, but not outside of the source code folder

                            @jsulm said in Impossible Generate Executable whit its dependecy:

                            That's because QtCreator expects the build folder to be outside the source tree. Any reason why you want to have the build folder inside the tree folder?

                            That what i'm trying to do, i want to build it on my desktop and not on my source tree, but it build on the source tree even if i don't want and say otherwise, and if i try to move the .exe it say it miss some dll that are not even on the project or anywhere on my computer

                            (i think the name of the topic is not the best one whit some insight on the issues i have now)

                            Pl45m4P Offline
                            Pl45m4P Offline
                            Pl45m4
                            wrote last edited by
                            #13

                            @AntGP said in Impossible Generate Executable whit its dependecy:

                            It can be built, but not outside of the source code folder

                            So it builds in your IDE?
                            Then you are looking for Qt Deployment to run it standalone (as far as possible, you gonna need some DLLs to ship your app) as .exe


                            If debugging is the process of removing software bugs, then programming must be the process of putting them in.

                            ~E. W. Dijkstra

                            1 Reply Last reply
                            1
                            • A Offline
                              A Offline
                              AntGP
                              wrote last edited by
                              #14

                              image.png

                              I'v tried to follow the tutorial, then to follow some youtube video ( https://www.youtube.com/watch?v=rFHPOZoqzcg) but it still doesn't work, it do the same and ask for some dll that are not existing at all
                              But it doesnt ask for them if im on the source tree

                              1 Reply Last reply
                              0
                              • A Offline
                                A Offline
                                AntGP
                                wrote last edited by AntGP
                                #15

                                *it appear they where on mingw

                                but now it don't work at all
                                c554710e-b7a9-4f88-b343-ac385b18467c-image.png

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

                                  Ok, so they should have used the .pri extension (it's mainly a convention but it clearly separates a project file from a inclusion file (and the .prf which is for features).

                                  The main issue here is that the project forces everything to be "in-tree". It should not be PWD but OUT_PWD for anything that is related to build artifacts. However, you should just remove these lines (DESTDIR and OBJECTS_DIR).

                                  As for starting the application, did you modify the PATH environment variable in the Run part of the Project panel so that the dependencies can be found ? (do not do it system wide).

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

                                  A 1 Reply Last reply
                                  1
                                  • hskoglundH Offline
                                    hskoglundH Offline
                                    hskoglund
                                    wrote last edited by
                                    #17

                                    Also, to add to @SGaist, that last error you got (0xc000007b) means that while you copied the correct names of the dlls, you copied the wrong version of them:
                                    the 64-bit version of the dlls when the ,exe file is 32-bit or the other way around.

                                    JonBJ 1 Reply Last reply
                                    1
                                    • hskoglundH hskoglund

                                      Also, to add to @SGaist, that last error you got (0xc000007b) means that while you copied the correct names of the dlls, you copied the wrong version of them:
                                      the 64-bit version of the dlls when the ,exe file is 32-bit or the other way around.

                                      JonBJ Online
                                      JonBJ Online
                                      JonB
                                      wrote last edited by
                                      #18

                                      @hskoglund That would be useful to know, does that error number always indicate a 32-/64-bit mismatch?

                                      1 Reply Last reply
                                      0
                                      • hskoglundH Offline
                                        hskoglundH Offline
                                        hskoglund
                                        wrote last edited by
                                        #19

                                        Yeah, pretty much always. (Much better compared to the other error 0xc000007c, which can occur due to multiple different reasons.)

                                        JonBJ 1 Reply Last reply
                                        1
                                        • hskoglundH hskoglund

                                          Yeah, pretty much always. (Much better compared to the other error 0xc000007c, which can occur due to multiple different reasons.)

                                          JonBJ Online
                                          JonBJ Online
                                          JonB
                                          wrote last edited by
                                          #20

                                          @hskoglund I'll try to remember 7b over 7c :)

                                          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