[SOLVED] How to build Qt 4.7 on win7(x64)?



  • Hi,

    I want to install Qt 4.7 on windows 7 64bit.
    I downloaded qt-everywhere-opensource-src-4.7.1.tar.gz.

    And I tryed to install to refer to this page.
    http://www.holoborodko.com/pavel/2011/02/01/how-to-compile-qt-4-7-with-visual-studio-2010/

    I can finish to build Qt library (with Visual Studio x64 Win64 Command Prompt (2010)).
    However I can't build Qt project.

    For example,

    @>qmake -project

    qmake hello.pro
    make
    make -f Makefile.Debug
    make[1]: Entering directory /c/Work/Qt/hello' Makefile.Debug:58: *** missing separator. Stop. make[1]: Leaving directory/c/Work/Qt/hello'
    make: *** [debug] Error 2

    nmake
    Microsoft(R) Program Maintenance Utility Version 10.00.40219.01
    Copyright (C) Microsoft Corporation. All rights reserved.

        "c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\amd64\nmake.
    

    exe" -f Makefile.Debug

    Microsoft(R) Program Maintenance Utility Version 10.00.40219.01
    Copyright (C) Microsoft Corporation. All rights reserved.

        link /LIBPATH:"c:\Qt\4.7.1\lib" /NOLOGO /DEBUG /MANIFEST /MANIFESTFILE:"
    

    debug\hello.intermediate.manifest" /SUBSYSTEM:WINDOWS "/MANIFESTDEPENDENCY:type=
    'win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToke
    n='6595b64144ccf1df' language='' processorArchitecture=''" /OUT:debug\hello.ex
    e @C:\Users\UserName\AppData\Local\Temp\nm51C8.tmp
    QtGuid4.lib(QtGuid4.dll) : fatal error LNK1112: module machine type ‘x64′ conflicts with target machine type ‘X86′
    NMAKE : fatal error U1077: '"c:\Program Files (x86)\Microsoft Visual Studio 10.0
    \VC\BIN\amd64\link.EXE"' : return code '0x458'
    Stop.
    NMAKE : fatal error U1077: '"c:\Program Files (x86)\Microsoft Visual Studio 10.0
    \VC\BIN\amd64\nmake.exe"' : return code '0x2'
    Stop.
    @
    My environment is as follows:

    • Win7 Pro SP1(x64)
    • Visual Studio 2010 SP1
    • Qt 4.7.1
    • Qt Add-in 1.1.11

    I tryed to install to change Qt version or configure options, but they were failed all.
    What is wrong?


  • Moderators

    You need to download the .zip package, not tarball.



  • Oh, I see... I got it.
    I try it now. Thanks for your advice!


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    To add to sierdzio, beware of your Visual Studio project architecture, you're having a mismatch there e.g. not using a 64 bit command line when creating the project ?



  • Unn... I got same result when I replaced a zipped source file.

    [quote author="SGaist" date="1401174432"]Hi and welcome to devnet,

    To add to sierdzio, beware of your Visual Studio project architecture, you're having a mismatch there e.g. not using a 64 bit command line when creating the project ?[/quote]

    Thank you, Mr. SGaist!
    Oh.. I didn't check it.

    I will try to run "vcvarsall.bat amd64" before a configure command.
    Is this correct?



  • I run following commands (every line is a different command: type it then press Enter):

    @>vcvarsall.bat amd64

    cd c:\Qt\4.7.1
    configure -debug-and-release -opensource -platform win32-msvc2010
    ..\jom\jom.exe -j 4@

    But, I can't get a good result(, because I get same result).

    I check a command line, then this look like a 64 bit command line.

    @>cl -help

    Microsoft(R) C/C++ Optimizing Compiler Version 16.00.30319.01 for x64
    Copyright (C) Microsoft Corporation. All rights reserved.

                         C/C++ COMPILER OPTIONS
    

    ... @

    What I need to do other, for the solution of this problem?


  • Moderators

    Hm, I am not sure, but some old versions of Qt required running configure.exe instead of configure.

    Also, try adding -arch x64 to the configure line.



  • [quote author="sierdzio" date="1401188082"]Hm, I am not sure, but some old versions of Qt required running configure.exe instead of configure.

    Also, try adding -arch x64 to the configure line.[/quote]

    Thank you, Mr. sierxzio!
    When I tryed adding -arch x64, I failed to run a jom command (and a nmake command too).

    This is its error message.

    In case a jom command:
    @c:\qt\4.7.0\include\qtcore../../src/corelib/arch/qatomic_arch.h(92) : fatal error C1189: #error : "Qt has not been ported to this architecture"

    jom: C:\Qt\4.7.0\src\winmain\Makefile.Release [tmp\obj\release_shared\qtmain_win.obj] Error 2
    jom: C:\Qt\4.7.0\src\winmain\Makefile [release-all] Error 2
    jom: C:\Qt\4.7.0\Makefile [sub-winmain-make_default-ordered] Error 2@

    In case a nmake command:
    @c:\qt\4.7.0\include\qtcore../../src/corelib/arch/qatomic_arch.h(92) : fatal error C1189: #error : "Qt has not been ported to this architecture"

    NMAKE : fatal error U1077: '"c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\amd64\cl.EXE"' : return code '0x2'
    Stop.
    NMAKE : fatal error U1077: '"c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\amd64\nmake.exe"' : return code '0x2'
    Stop.
    NMAKE : fatal error U1077: 'cd' : return code '0x2'
    Stop.@

    Does this message mean this command line is not 64 bit?


  • Moderators

    Maybe try with Qt 4.8.6?



  • Thank you, Mr. sierdzio.
    But I became possible to build to use Qt 4.7.1 libraries on VC2010, after to rebuild this libraries.

    A cause of this problem is outside their method...
    I have a misunderstanding how to use add-in.

    Until tomorrow, I opened a solution file(*.sln) of Qt project
    (created by a qmake -tp vc command). But it is wrong.

    I can x64 debug build a Qt project from a Qt project file(*.pro) by add-in .

    At first time, it was failed before post a question to this forum.
    Maybe, this problem had other causes then.

    .

    ...And I'm worry about something.
    It is failed to build by make and nmake commands on command line.
    Is this correct?



  • O.K.
    I don't understand make errors.
    But, I mark [SOLVED] on this title because I became possible to use Qt 4.7.

    Many thanks, Mr. sierdzio and Mr. SGaist!


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.