Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Double build of base dependency in Qt Creator 2.2.0
Forum Updated to NodeBB v4.3 + New Features

Double build of base dependency in Qt Creator 2.2.0

Scheduled Pinned Locked Moved Qt Creator and other tools
8 Posts 3 Posters 3.3k 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.
  • I Offline
    I Offline
    icecr0wn
    wrote on 8 Jul 2011, 15:43 last edited by
    #1

    Hello everyone,

    I am using Qt Creator 2.2.0 (rev: 8c74bc10d4) on RHEL 5.4 (x86_64) at work

    I am currently experimenting to convert kdevelop/eclipse projects to QtCreator.
    So far everything goes well, everything builds separately.
    I was experimenting with the build dependencies but I came across something weird.

    I have a standard library called StandardLib. It contains many common stuff like string, containers etc.
    I also have two separated libraries, called LibA and LibB which are dependent on StandardLib but not each other.
    If I set the build dependencies for LibA to StandardLib and for LibB to StandardLib, they both build fine.

    The problem is with the following:
    I have a SpecialLib which is dependent on all three libraries. Because LibA and LibB are already dependent on StandardLib I though I would omit that one. So I set the dependencies to just LibA and LibB.
    First I started the build and it worked fine, but I didn't look at the output nor did I run any tests.

    Then I changed a thing or two in the SpecialLib and started the build and looked carefully at the output, to see if the make's and configures ran fine. What I saw is that the output of StandardLib is outputted twice.
    Something like:

    @
    Checking for gcc...yes
    Checking for gcc...yes
    Checking for g++...yes
    Checking for g++...yes
    @

    or.

    @
    g++ [g++ options] file1.cpp -o file1.o
    g++ [g++ options] file1.cpp -o file1.o
    g++ [g++ options] file2.cpp -o file2.o
    g++ [g++ options] file2.cpp -o file2.o
    @
    My guess is, because SpecialLib as two dependencies on StandardLib (one through LibA and one through LibB) the build is started twice.

    I would expect Qt Creator to be smart enough to filter out the second one and just start the build for StandardLib only once.

    Is this a bug? Perhaps I am missing something.
    Hopefully you may be of any help.

    Thanks in advance

    1 Reply Last reply
    0
    • D Offline
      D Offline
      Duck
      wrote on 9 Jul 2011, 21:33 last edited by
      #2

      How did you "convert"? Did you create a .pro file? If so, how does it look like?

      1 Reply Last reply
      0
      • T Offline
        T Offline
        tobias.hunger
        wrote on 10 Jul 2011, 08:34 last edited by
        #3

        Note that this is an issue of your build system of choice, not Qt Creator. I guess you are using a qmake (.pro-file) based project?

        1 Reply Last reply
        0
        • I Offline
          I Offline
          icecr0wn
          wrote on 10 Jul 2011, 15:36 last edited by
          #4

          Thanks for your responses.

          At my work I imported several Makefile.am projects, added to build steps manually (make -f Makefile.dist, configure, make). Builds fine and the results runs the same as thouhg I would be using our build script.

          I also saw the problem with qmake projects from scratch at my Windows 7 Ultimate 64bit PC at home. Though that version is a little bit newer then the one in my first post, but it shows the exact same effects (still 2.2.0)

          I did the following to reproduce:

          create an empty project directory on disk (d:test). All projects hereafter use this directory as their base.

          started Qt Creator and created an new empty session called 'qt test'

          I first created a new project, Qt Widget Project - Qt Gui Application, called 'app'

          I created three new projects of type 'Other Project - C++ Library', all static libraries with name in this order: 'stdlib', 'libA', 'libB'. I added QtXml and QtXmlPatterns to libA

          I went to 'Projects' to set the dependencies as follows:

          • app depends on both libA and libB
          • libA depends on stdlib
          • libB depents on stdlib

          Now build

          Problem reproduced. It's stdlib that is shown twice in the buildlog.

          I'll hope it is usefull and you may come up with a solution.
          Thank you in advance.

          First I'll show the first part of the buildlog so you can see what I am talking about. Then the four .pro files.

          @Running build steps for project stdlib...
          Configuration unchanged, skipping qmake step.
          Configuration unchanged, skipping qmake step.
          Starting: "D:QtSDKmingwbinmingw32-make.exe"
          Starting: "D:QtSDKmingwbinmingw32-make.exe"
          D:/QtSDK/mingw/bin/mingw32-make -f Makefile.Debug
          D:/QtSDK/mingw/bin/mingw32-make -f Makefile.Debug
          mingw32-make[1]: Entering directory D:/test/stdlib-build-desktop' mingw32-make[1]: Entering directory D:/test/stdlib-build-desktop'
          g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -I"....QtSDKDesktopQt4.7.3mingwincludeQtCore" -I"....QtSDKDesktopQt4.7.3mingwinclude" -I"....QtSDKDesktopQt4.7.3mingwincludeActiveQt" -I"debug" -I"..stdlib" -I"." -I"....QtSDKDesktopQt4.7.3mingwmkspecswin32-g++" -o debugstdlib.o ..stdlibstdlib.cpp
          g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -I"....QtSDKDesktopQt4.7.3mingwincludeQtCore" -I"....QtSDKDesktopQt4.7.3mingwinclude" -I"....QtSDKDesktopQt4.7.3mingwincludeActiveQt" -I"debug" -I"..stdlib" -I"." -I"....QtSDKDesktopQt4.7.3mingwmkspecswin32-g++" -o debugstdlib.o ..stdlibstdlib.cpp
          ar -ru debuglibstdlib.a debug/stdlib.o
          ar -ru debuglibstdlib.a debug/stdlib.o
          mingw32-make[1]: Leaving directory D:/test/stdlib-build-desktop' mingw32-make[1]: Leaving directory D:/test/stdlib-build-desktop'
          The process "D:QtSDKmingwbinmingw32-make.exe" exited normally.
          The process "D:QtSDKmingwbinmingw32-make.exe" exited normally.
          Running build steps for project libA...
          Configuration unchanged, skipping qmake step.
          Starting: "D:QtSDKmingwbinmingw32-make.exe"
          D:/QtSDK/mingw/bin/mingw32-make -f Makefile.Debug
          mingw32-make[1]: Entering directory `D:/test/libA-build-desktop'
          g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_XMLPATTERNS_LIB -DQT_XML_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -I"....QtSDKDesktopQt4.7.3mingwincludeQtCore" -I"....QtSDKDesktopQt4.7.3mingwincludeQtXml" -I"....QtSDKDesktopQt4.7.3mingwincludeQtXmlPatterns" -I"....QtSDKDesktopQt4.7.3mingwinclude" -I"....QtSDKDesktopQt4.7.3mingwincludeActiveQt" -I"debug" -I"..libA" -I"." -I"....QtSDKDesktopQt4.7.3mingwmkspecswin32-g++" -o debugliba.o ..libAliba.cpp
          @

          The four pro files look as follows:
          app.pro
          @
          #-------------------------------------------------

          Project created by QtCreator 2011-07-10T17:11:54

          #-------------------------------------------------

          QT += core gui

          TARGET = app
          TEMPLATE = app

          SOURCES += main.cpp
          mainwindow.cpp

          HEADERS += mainwindow.h

          FORMS += mainwindow.ui

          @

          libA.pro
          @
          #-------------------------------------------------

          Project created by QtCreator 2011-07-10T17:14:02

          #-------------------------------------------------

          QT += xml xmlpatterns

          QT -= gui

          TARGET = libA
          TEMPLATE = lib
          CONFIG += staticlib

          SOURCES += liba.cpp

          HEADERS += liba.h
          unix:!symbian {
          maemo5 {
          target.path = /opt/usr/lib
          } else {
          target.path = /usr/lib
          }
          INSTALLS += target
          }
          @

          libB.pro
          @
          #-------------------------------------------------

          Project created by QtCreator 2011-07-10T17:14:29

          #-------------------------------------------------

          QT -= gui

          TARGET = libB
          TEMPLATE = lib
          CONFIG += staticlib

          SOURCES += libb.cpp

          HEADERS += libb.h
          unix:!symbian {
          maemo5 {
          target.path = /opt/usr/lib
          } else {
          target.path = /usr/lib
          }
          INSTALLS += target
          }

          @

          stdlib.pro
          @
          #-------------------------------------------------

          Project created by QtCreator 2011-07-10T17:13:02

          #-------------------------------------------------

          QT -= gui

          TARGET = stdlib
          TEMPLATE = lib
          CONFIG += staticlib

          SOURCES += stdlib.cpp

          HEADERS += stdlib.h
          unix:!symbian {
          maemo5 {
          target.path = /opt/usr/lib
          } else {
          target.path = /usr/lib
          }
          INSTALLS += target
          }
          @

          1 Reply Last reply
          0
          • D Offline
            D Offline
            Duck
            wrote on 10 Jul 2011, 18:40 last edited by
            #5

            I don't see any libs "usage", i.e. LIBS += ... and the output from the build looks indeed strange as every command seems to run twice.

            1 Reply Last reply
            0
            • I Offline
              I Offline
              icecr0wn
              wrote on 11 Jul 2011, 06:54 last edited by
              #6

              Thanks for your reply Duck.

              The fact you are missing the libs usage is intentional. It doesn't matter whether they are there or not.
              The double run of commands is what I am pointing to.

              While the point is now clear, the question remains: Am I missing something or is this a bug and should I report this?

              Thanks in advance

              1 Reply Last reply
              0
              • D Offline
                D Offline
                Duck
                wrote on 11 Jul 2011, 16:35 last edited by
                #7

                The commands clearly should not run twice. I wonder whether they really do, or whether this is only some kind of display error in the Compile Output pane. There seem to be a few backslashes missing, too.

                1 Reply Last reply
                0
                • I Offline
                  I Offline
                  icecr0wn
                  wrote on 11 Jul 2011, 16:45 last edited by
                  #8

                  I'll try to look into this, to see if it is just displayed twice or also ran twice. If the latter, I guess it could be a potential for some troubles. If it just display, it is a mere annoyance (a big one though!)

                  1 Reply Last reply
                  0

                  1/8

                  8 Jul 2011, 15:43

                  • Login

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