Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. How to choose 32bit compiler on 64bit QT Creator(Windows7 x64)
QtWS25 Last Chance

How to choose 32bit compiler on 64bit QT Creator(Windows7 x64)

Scheduled Pinned Locked Moved Solved Installation and Deployment
15 Posts 3 Posters 8.3k 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.
  • ChunKai-WangC Offline
    ChunKai-WangC Offline
    ChunKai-Wang
    wrote on last edited by
    #1

    Hi,

    Have anyone knows how to build 32bit program by QT Creator 64bit?

    I have a 32bit visual c++ library need to be included to QT project,
    it seems that must be used on QT Creator 32bit or it always get
    "...LNK2019: unresolved external symbol..."

    Currently,
    I installed both QT Creator 32/64bit on my working machine and it looks workable,

    I would like to consulting that whether have anyway to build 32bit program on QT Creator 64bit?
    (ex: copy some files/libs from 32bit QT to 64bit...)

    Thanks~

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

      Hi,

      It's not a Qt Creator decision (it's only an IDE) and Qt Creator's architecture also has nothing to do with that.

      You have to install Qt for the architecture you want to build for (that's valid for any library you want to use not just Qt).

      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
      • jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #3

        To add to what SGaist said: in addition to Qt 32bit you need a compiler generating 32bit binaries.

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

        1 Reply Last reply
        0
        • ChunKai-WangC Offline
          ChunKai-WangC Offline
          ChunKai-Wang
          wrote on last edited by ChunKai-Wang
          #4

          In "QT Version" tab of toolbar->Tools->Options->Build&Run,
          I noticed it point to a folder "<QT_32bit path>\Qt5.5.1\5.5\msvc2013" for QT_32bit,
          "<QT_64bit path>\Qt5.5.1\5.5\msvc2013_64" for QT_64bit,

          I tried to copy msvc2013 folder from QT_32bit to QT_64bit,
          then I can see msvc2013 32bit compilers from Compilers tab in Build&Run,
          and I can manual add msvc2013 32bit to QT Versions, Kits tab in Build&Run,

          after those, I can include the 32bit library and build/run my program through QT_64bit.

          But I'm not sure that everything will be fine,
          I tried to compare installation path of QT_32bit and QT_64bit,
          they're basically same but the root location of installation path has a file components.xml,

          the file seems something to describe components setting for QT,
          that is different between QT 32bit and 64bit,
          I guess something will be wrong if I keep developing 32bit program on QT_64bit...?

          1 Reply Last reply
          0
          • jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #5

            "I tried to copy msvc2013 folder from QT_32bit to QT_64bit" - why?
            I really don't understand what you are doing.

            You just need two things:

            1. 32bit Qt
            2. Compiler generating 32bit code

            That means if you have msvc2013 then install Qt msvc2013 (it is called "msvc2013 32-bit" in Qt maintenance tool), create a kit and select Qt32bit and the 32 bit msvc compiler there. You should already see the compiler in the "Compilers" tab - it has (x86) suffix.

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

            ChunKai-WangC 1 Reply Last reply
            0
            • jsulmJ jsulm

              "I tried to copy msvc2013 folder from QT_32bit to QT_64bit" - why?
              I really don't understand what you are doing.

              You just need two things:

              1. 32bit Qt
              2. Compiler generating 32bit code

              That means if you have msvc2013 then install Qt msvc2013 (it is called "msvc2013 32-bit" in Qt maintenance tool), create a kit and select Qt32bit and the 32 bit msvc compiler there. You should already see the compiler in the "Compilers" tab - it has (x86) suffix.

              ChunKai-WangC Offline
              ChunKai-WangC Offline
              ChunKai-Wang
              wrote on last edited by
              #6

              @jsulm said:

              "I tried to copy msvc2013 folder from QT_32bit to QT_64bit" - why?

              Just try to build 32bit program by 64bit QT,
              because I have installed 64bit QT and I don't like to install whole 32bit QT just for building 32bit program,
              (I have ubuntu and windows in same hard drive, the space is running out...)

              so I guess maybe I can copy something from 32bit QT to 64bit QT...?
              and yes, after I copied the folder I can build 32bit program through 64bit QT,
              but I don't know whether that is no problem...

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

                From your description you just overwrote the content of your 64bit Qt.

                And no that's not an option, if you want to build for both architecture, you'll need to have both version of Qt installed. Note that you don't need to grab both offline installers to get them. The online installer offer to install both.

                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
                • ChunKai-WangC ChunKai-Wang

                  @jsulm said:

                  "I tried to copy msvc2013 folder from QT_32bit to QT_64bit" - why?

                  Just try to build 32bit program by 64bit QT,
                  because I have installed 64bit QT and I don't like to install whole 32bit QT just for building 32bit program,
                  (I have ubuntu and windows in same hard drive, the space is running out...)

                  so I guess maybe I can copy something from 32bit QT to 64bit QT...?
                  and yes, after I copied the folder I can build 32bit program through 64bit QT,
                  but I don't know whether that is no problem...

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

                  @ChunKai-Wang No, you cannot build 32bit app using 64bit Qt! You just overwrote your 64bit Qt with 32bit one. You have to install 32bit Qt if you want to build 32bit Qt apps. I don't see why it is an issue to install it, hard drive space does not cost much these days.

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

                  1 Reply Last reply
                  0
                  • ChunKai-WangC Offline
                    ChunKai-WangC Offline
                    ChunKai-Wang
                    wrote on last edited by
                    #9

                    Actually I don't think what I did is overwriting,
                    because I didn't overwrite anything, but just add a folder "msvc2013" from 32bit QT to 64bit QT,
                    in 64bit QT, the folder is named "msvc2013_64", that won't be touched.

                    then I have choices of 32bit or 64bit in 64bit QT, both them can be built and run.
                    of course I doubt that would keep no problem...

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

                      Did you copy or move the folder ?

                      In any case, you could have spared the place from the beginning using the online installer.

                      I'd recommend you do the cleanup so you ensure you have a proper setup to develop.

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

                      ChunKai-WangC 1 Reply Last reply
                      0
                      • SGaistS SGaist

                        Did you copy or move the folder ?

                        In any case, you could have spared the place from the beginning using the online installer.

                        I'd recommend you do the cleanup so you ensure you have a proper setup to develop.

                        ChunKai-WangC Offline
                        ChunKai-WangC Offline
                        ChunKai-Wang
                        wrote on last edited by
                        #11

                        Hi @SGaist ,
                        I did offline install for 32bit and 64bit QT to different path,
                        then copy msvc2013 folder from
                        32bit QT installation path (C:\QT_x86\QT5.5.1\)
                        to
                        64bit QT installation path (C:\QT\QT5.5.1\),
                        this is just an experiment...

                        I think QT IDE can choose 32bit or 64bit compiler,
                        but it doesn't be released as such bundle,
                        not sure why,
                        however I'll keep working on QT 32bit for using the 32bit library,
                        maybe remove QT 64bit for saving space because I should not really need 64bit program.

                        Hi @jsulm ,
                        about hard drive, price isn't problem,
                        the problem is my notebook has only one slot...

                        Thanks~

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

                          Qt Creator doesn't care about which architecture your Qt is built for. It also allows to build projects for Android/iOS/generic devices/etc.

                          Because usually people wanting to support several architectures or MSVC compilers will go with the online installer.

                          The offline packages are targeting one architecture for one compiler so it stays in a reasonable size.

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

                          ChunKai-WangC 1 Reply Last reply
                          0
                          • SGaistS SGaist

                            Qt Creator doesn't care about which architecture your Qt is built for. It also allows to build projects for Android/iOS/generic devices/etc.

                            Because usually people wanting to support several architectures or MSVC compilers will go with the online installer.

                            The offline packages are targeting one architecture for one compiler so it stays in a reasonable size.

                            ChunKai-WangC Offline
                            ChunKai-WangC Offline
                            ChunKai-Wang
                            wrote on last edited by
                            #13

                            @SGaist said:

                            ecause usually people wanting to support several architectures or MSVC compilers will go with

                            Hi @SGaist ,
                            So if I use online install QT, it would include 32bit and 64bit option for compiling?

                            Thanks~

                            1 Reply Last reply
                            0
                            • jsulmJ Offline
                              jsulmJ Offline
                              jsulm
                              Lifetime Qt Champion
                              wrote on last edited by
                              #14

                              If you use the online installer you can select which Qt you want to install. You can even install Qt for Android for example.

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

                              1 Reply Last reply
                              0
                              • ChunKai-WangC Offline
                                ChunKai-WangC Offline
                                ChunKai-Wang
                                wrote on last edited by
                                #15

                                Ah....haha, online installation solved 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