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. How to build Win64 project using Win32 OS.
Forum Updated to NodeBB v4.3 + New Features

How to build Win64 project using Win32 OS.

Scheduled Pinned Locked Moved General and Desktop
10 Posts 3 Posters 6.6k 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.
  • A Offline
    A Offline
    aikidzin
    wrote on 12 Jan 2012, 07:55 last edited by
    #1

    Good day.
    I need to build a project using Windows XP x86 to run in Win x64. How can I do it?
    MVS2010 has x86_amd64 compiller. So, MSVS2010 lets me to build the project for Win64 using Win32.
    When I run qmake, it creates lnk file with paths where Qt was installed (c:\Qt\4.7.4). If I move qt dirrectory, qmake creates file with the same paths (c:\Qt\4.7.4). So, I think that this paths are in qt binaries. Can I change this paths to run from the network disk?

    1 Reply Last reply
    0
    • G Offline
      G Offline
      goetz
      wrote on 12 Jan 2012, 11:15 last edited by
      #2

      [quote author="aikidzin" date="1326354925"]Good day.
      I need to build a project using Windows XP x86 to run in Win x64. How can I do it?
      [/quote]

      The 64bit versions of Windows can happily run 32bit code. Do you really need a 64bit version of your application?

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • A Offline
        A Offline
        aikidzin
        wrote on 12 Jan 2012, 11:47 last edited by
        #3

        I build dinamic library, that will be used by x64 native application. I think x32 library will not link with x64 application.

        1 Reply Last reply
        0
        • B Offline
          B Offline
          bu7ch3r
          wrote on 12 Jan 2012, 12:26 last edited by
          #4

          You can build x64 but you need to compile qt in x64. There are a lot of ways to do that. If you want to use nmake you must start the visual studio console that is for x64. You can find it in start menu at Visual Studio Tools or something Visual Studio 2008 x64 Cross Tools Command Prompt....
          Having the x64 version of Qt you must select in visual studio the configuration to x64 then click on Qt from the menu/ Qt options and add the path for the version.
          At this point you should have in the list both Qt versions. After that click again on Qt/ Qt project settings and in the last line add x64 version than build ...

          for(int i = 200; i > 0;)
          try
          {
          //do something
          }
          catch(...)
          {
          i--;//try again
          }

          1 Reply Last reply
          0
          • A Offline
            A Offline
            aikidzin
            wrote on 13 Jan 2012, 07:09 last edited by
            #5

            I already built x64 and x32 versions of Qt.
            I build my project from command line, I don't use IDE. As I build in Win32, I must run 32bit version of qmake. And qmake creates file with INCPATHs from c:\Qt\4.7.4, but not from the directory, where qmake is. If I have 64bit of qmake, I can run it only in Win64.

            @E:\Compiler\QT\4.7.4\bin\qmake.exe ..\myqt.pro -o qmyqt.lnk -spec win32-msvc2010
            E:\Compiler\MSVC100\VC\bin\nmake.exe -f qmyqt.lnk
            cl -c -nologo -Zm200 -Zc:wchar_t- -Zi -MDd -GR -EHsc -W3 -w34100 -w34189 -DUNICODE -DWIN32 -D_AMD64_ -DQT_DLL -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -I"c:\Qt\4.7.4\include\QtCore" -I"c:\Qt\4.7.4\include\QtSql" -I"c:\Qt\4.7.4\include" -I"c:\Qt\4.7.4\include\ActiveQt" -I"c:\Qt\4.7.4\mkspecs\win32-msvc2010" qmyqt.cpp@

            1 Reply Last reply
            0
            • B Offline
              B Offline
              bu7ch3r
              wrote on 13 Jan 2012, 07:45 last edited by
              #6

              Before compiling run: vcvarsall.bat"" x86_amd64, or E:\Compiler\MSVC100\VC\vcvarsall.bat"" x86_amd64, should work.

              c:\Qt\4.7.4\ is the path to x64 build of Qt?

              for(int i = 200; i > 0;)
              try
              {
              //do something
              }
              catch(...)
              {
              i--;//try again
              }

              1 Reply Last reply
              0
              • A Offline
                A Offline
                aikidzin
                wrote on 13 Jan 2012, 08:23 last edited by
                #7

                No, c:\Qt\4.7.4\ is the dirrectory, where 32bit version of Qt was installed. I moved that dirrectory to the E:\Compiler\QT\4.7.4. Also, I have directory with 64bit Qt - E:\Compiler\QT\4.7.4_x64.

                I ran E:\Compiler\MSVC100\VC\vcvarsall.bat x86_amd64 before compiling. No effect.
                Can I manually change paths after qmake in the lnk file to use 64bit version?
                Now in lnk file after qmake
                QMAKE = e:\Compiler\QT\4.7.4\bin\qmake.exe
                INCPATH = -I"c:\Qt\4.7.4\include\QtCore".......

                1 Reply Last reply
                0
                • B Offline
                  B Offline
                  bu7ch3r
                  wrote on 13 Jan 2012, 08:45 last edited by
                  #8

                  Try this:
                  @
                  1.vcvarsall.bat"" x86_amd64
                  2.E:\Compiler\QT\4.7.4\bin\qmake.exe ..\myqt.pro -o qmyqt.lnk -spec win32-msvc2010
                  3.E:\Compiler\MSVC100\VC\bin\nmake.exe -f qmyqt.lnk
                  cl -c -nologo -Zm200 -Zc:wchar_t- -Zi -MDd -GR -EHsc -W3 -w34100 -w34189 -DUNICODE -DWIN32 -D_AMD64_ -DQT_DLL -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -I"E:\Compiler\QT\4.7.4_x64\include\QtCore" -I"E:\Compiler\QT\4.7.4_x64\include\QtSql" -I"E:\Compiler\QT\4.7.4_x64\include" -I"E:\Compiler\QT\4.7.4_x64\include\ActiveQt" -I"E:\Compiler\QT\4.7.4_x64\mkspecs\win32-msvc2010" qmyqt.cpp
                  @

                  for(int i = 200; i > 0;)
                  try
                  {
                  //do something
                  }
                  catch(...)
                  {
                  i--;//try again
                  }

                  1 Reply Last reply
                  0
                  • B Offline
                    B Offline
                    bu7ch3r
                    wrote on 13 Jan 2012, 09:02 last edited by
                    #9

                    Also try changing the vars for qt. Before 1.vcvarsall.bat enter this:

                    set QTDIR= E:\Compiler\QT\4.7.4_x64
                    set PATH= E:\Compiler\QT\4.7.4_x64\bin;%PATH%
                    set QMAKESPEC=win32-msvc2010

                    for(int i = 200; i > 0;)
                    try
                    {
                    //do something
                    }
                    catch(...)
                    {
                    i--;//try again
                    }

                    1 Reply Last reply
                    0
                    • A Offline
                      A Offline
                      aikidzin
                      wrote on 16 Jan 2012, 08:13 last edited by
                      #10

                      I executed
                      set QTDIR= E:\Compiler\QT\4.7.4_x64
                      set PATH= E:\Compiler\QT\4.7.4_x64\bin;PATH
                      set QMAKESPEC=win32-msvc2010
                      E:\Compiler\MSVC100\VC\vcvarsall.bat x86_amd64
                      E:\Compiler\QT\4.7.4\bin\qmake.exe ..\myqt.pro -o qmyqt.lnk -spec win32-msvc2010
                      but in qmyqt.lnk.Debug INCPATH still
                      INCPATH = -I"c:\Qt\4.7.4\include\QtCore" .......

                      1 Reply Last reply
                      0

                      1/10

                      12 Jan 2012, 07:55

                      • Login

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