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. [Original problem solved] Using different tool chains in creator
Forum Updated to NodeBB v4.3 + New Features

[Original problem solved] Using different tool chains in creator

Scheduled Pinned Locked Moved Qt Creator and other tools
15 Posts 3 Posters 4.7k 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.
  • K Offline
    K Offline
    koahnig
    wrote on last edited by
    #3

    Thanks for answer.
    I am working with creator 2.2.0. The platform is Ubuntu. I want compile for debugging on the host and also do cross-compilation.
    I have switched the build configuration under Projects->Build settings , but does not seem to different from Ctrl-T.
    Under MSVC you can simply change from debug to release and press build. So I hoped that it may be similar with the creator.

    Vote the answer(s) that helped you to solve your issue(s)

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tobias.hunger
      wrote on last edited by
      #4

      Hmmm... Ctrl-T, Tab, arrow up/down, to switch the build configuration, ESC to close the dialog and Ctrl-B to trigger the build. Seems acceptable to me:-)

      1 Reply Last reply
      0
      • K Offline
        K Offline
        koahnig
        wrote on last edited by
        #5

        well, if you have to do this for let's 4 to 5 libs and the application, you may end up with a mess/mix if you are not careful.

        Vote the answer(s) that helped you to solve your issue(s)

        1 Reply Last reply
        0
        • T Offline
          T Offline
          tobias.hunger
          wrote on last edited by
          #6

          Oh, your application consists of several distinct parts?

          Why don't you write a pro-file to bind them all together? The subdirs template works fine for that:-)

          1 Reply Last reply
          0
          • K Offline
            K Offline
            koahnig
            wrote on last edited by
            #7

            ok?
            First, yes, the application has several distinct parts. Respectively, I have a couple of applications sharing the same libs. The pressing problem is at the time for one application only. But certainly, it is good to a more general solution.
            Can you give me a hint on specific doc with an example?

            Vote the answer(s) that helped you to solve your issue(s)

            1 Reply Last reply
            0
            • K Offline
              K Offline
              koahnig
              wrote on last edited by
              #8

              [quote author="koahnig" date="1306826849"]
              Can you give me a hint on specific doc with an example? [/quote]
              I should have googled first. :-) I am coming back if I struggle with what I have found. Thanks anyway.

              Vote the answer(s) that helped you to solve your issue(s)

              1 Reply Last reply
              0
              • L Offline
                L Offline
                luca
                wrote on last edited by
                #9

                [quote author="Tobias Hunger" date="1306785408"]Hmmm... Ctrl-T, Tab, arrow up/down, to switch the build configuration, ESC to close the dialog and Ctrl-B to trigger the build. Seems acceptable to me:-)[/quote]
                Very good... from now it will be my building procedure too. :-D

                koahnig,
                if I undertood what you need you should do this in your .pro:
                @
                ...
                ...
                linux-g++ {
                #queste 4 righe seguenti servono per qextserialport:
                INCLUDEPATH += ../qextserialport_x86
                QMAKE_LIBDIR += ../qextserialport_x86/build
                LIBS += -lqextserialport
                DEFINES = TTY_POSIX
                }

                linux-arm-gnueabi-g++ {
                #queste 4 righe seguenti servono per qextserialport:
                INCLUDEPATH += ../qextserialport_beagle
                QMAKE_LIBDIR += ../qextserialport_beagle/build
                LIBS += -lqextserialport
                DEFINES = TTY_POSIX
                }
                @

                I use this to compile for my linux pc and to cross-compile for my beagleboard using qextserialport library.

                Remember that before this you need to compile the library for both platform and put it in different directories .

                1 Reply Last reply
                0
                • K Offline
                  K Offline
                  koahnig
                  wrote on last edited by
                  #10

                  Luca, thanks for info.

                  I will try it. With a little trial and error I ended with something like:

                  @
                  ...
                  ...
                  Host: INCLUDEPATH += ../qextserialport_x86
                  Arm: INCLUDEPATH += ../qextserialport_beagle
                  Host: QMAKE_LIBDIR += ../qextserialport_x86/build
                  Arm: QMAKE_LIBDIR += ../qextserialport_beagle/build
                  Host: LIBS += -lqextserialport
                  Arm: LIBS += -lqextserialport
                  DEFINES = TTY_POSIX
                  @
                  which could be rewritten as:
                  @
                  ...
                  ...
                  Host {
                  INCLUDEPATH += ../qextserialport_x86
                  QMAKE_LIBDIR += ../qextserialport_x86/build
                  LIBS += -lqextserialport
                  }
                  Arm {
                  INCLUDEPATH += ../qextserialport_beagle
                  QMAKE_LIBDIR += ../qextserialport_beagle/build
                  LIBS += -lqextserialport
                  }
                  DEFINES = TTY_POSIX
                  @

                  Arm or Host is set through the parameter list with "CONFIG+=Arm" for instance. I knew that it is a little wooden, but it worked and elegance was not my major target.

                  Now following your example, I may simplify also other steps, but I am not clear how to know the parameter "linux-arm-gnueabi-g++" or the slightly different version I probably need.
                  Is it one of the commands in *.conf?
                  Or is it the directory name where the conf is stored?

                  BTW I have generated a Qt version for cross compilation and that part is working. I have copied and adjusted for compiler path names a directory in "mkspecs/qws".

                  Vote the answer(s) that helped you to solve your issue(s)

                  1 Reply Last reply
                  0
                  • L Offline
                    L Offline
                    luca
                    wrote on last edited by
                    #11

                    [quote author="koahnig" date="1306839404"] I am not clear how to know the parameter "linux-arm-gnueabi-g++" or the slightly different version I probably need.

                    [/quote]

                    To know it you must enter your Qt source (mine is in /opt/qt4-4.7.1 and /opt/qt4-4.7.1-beagle) and type:
                    @
                    ls -l /opt/qt4-4.7.1/mkspecs/default
                    @
                    it's a symbolic link. I get this:
                    @
                    lrwxrwxrwx 1 root root 9 Dec 16 21:03 /opt/qt4-4.7.1/mkspecs/default -> linux-g++
                    @
                    so I must use linux-g++ when compiling for my linux PC.

                    While for my beagleboard (arm) :
                    @
                    ls -l /opt/qt4-4.7.1-beagle/mkspecs/default
                    @
                    I get:
                    @
                    /opt/qt4-4.7.1-beagle/mkspecs/default -> qws/linux-arm-gnueabi-g++/
                    @

                    So I must use "linux-arm-gnueabi-g++" .

                    That's all .

                    Let me know...

                    1 Reply Last reply
                    0
                    • K Offline
                      K Offline
                      koahnig
                      wrote on last edited by
                      #12

                      Yes, this does work.
                      The names you are determining through the symbolic link are the same as used for the -spec parameter used by creator for qmake.

                      Currently, I am struggling with the CONFIG parameter. I assumed that it contains either "debug" or "release". In creator you have the choices between "Debug", "Release" and "Debug and release".

                      I have added following statement to the .pro file:
                      @
                      message ("CONFIG = " $$CONFIG)
                      @

                      For debug the output is:
                      @
                      Project MESSAGE: CONFIG = lex yacc warn_on debug uic resources qt warn_on release incremental link_prl def_files_disabled no_mocdepend release stl qt_no_framework debug Arm staticlib
                      @

                      For release the output is:
                      @
                      Project MESSAGE: CONFIG = lex yacc warn_on debug uic resources qt warn_on release incremental link_prl def_files_disabled no_mocdepend release stl qt_no_framework Arm staticlib
                      @

                      For "Debug and release" the output is:
                      @
                      Project MESSAGE: CONFIG = lex yacc warn_on debug uic resources debug DebugBuild Debug build_pass qt warn_on release incremental link_prl def_files_disabled no_mocdepend release stl qt_no_framework debug_and_release Arm debug DebugBuild Debug build_pass staticlib
                      @

                      in qmake doc for "CONFIG":http://doc.qt.nokia.com/4.7/qmake-variable-reference.html#config
                      you can read that "relase" is ignored when "debug" is present. But the release and debug settings are containing both.

                      Am I compiling the whole time in debug mode even when switched to release?

                      I understand where the last (two/three) parameters in each CONFIG are coming from, but not the majority in the beginning.

                      Vote the answer(s) that helped you to solve your issue(s)

                      1 Reply Last reply
                      0
                      • L Offline
                        L Offline
                        luca
                        wrote on last edited by
                        #13

                        I can't help you but a fast check to a debug or release building consist in checking executable file size.
                        Debug building generate a bigger file...

                        I think someone in the DevNet can help you better... :-)

                        1 Reply Last reply
                        0
                        • K Offline
                          K Offline
                          koahnig
                          wrote on last edited by
                          #14

                          @Luca
                          Thanks for your input. It is appreciated.

                          Let us see, if someone is able to open the Gordean knot with CONFIG :-)

                          Vote the answer(s) that helped you to solve your issue(s)

                          1 Reply Last reply
                          0
                          • K Offline
                            K Offline
                            koahnig
                            wrote on last edited by
                            #15

                            The original problem is solved through the subdirs template of qmake.

                            Here is the example of my case
                            @
                            TEMPLATE = subdirs
                            CONFIG += ordered
                            SUBDIRS =
                            ALib
                            BLib
                            CLib
                            DLib
                            Applications/Appl1
                            @

                            Each directory needs a .pro-file with the same name as the directory name is.

                            Vote the answer(s) that helped you to solve your issue(s)

                            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