x86 build problem on x64 windows



  • Hi.

    Hope you can help me! I've downloaded the Qt source code on an Windows 8 x64 machine and I'm trying to compile it in x86. When I run configure.bat and then nmake I get the following error:

    fatal error LNK1112: module machine type ‘x64’ conflicts with target machine type ‘X86’

    How do I force the "module machine" to use x86? All search have lead to solutions containing a Visual Studio project file which I do not have.

    What I have done:

    • Downloaded Qt5.1 from "here":http://qt-project.org/downloads
    • Unzipped the source
    • Run configure.bat (used -nomake on examples and demos)
    • Run nmake
    • Tried using cygwin and a VS2012 x86 Native Tools Command Prompt (even x64 in desperation :) )

    What I have:

    • Windows 8 x64
    • Visual Studio 2012 Premium

    Output:
    ...
    trees.c
    uncompr.c
    zutil.c
    Generating Code...
    lib /NOLOGO /OUT:......\lib\Qt5Bootstrap.lib @C:\cygwin\tmp\nmB61A.tmp
    .obj\release_shared\qmalloc.obj : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'
    NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\lib.EXE"' : return code '0x458'

    [edit: fixed styling SGaist]


  • Lifetime Qt Champion

    Hi,

    Did you properly clean (or remove/unzip) your sources between two attempts ?



  • I might have - yes. Ran nmake clean with no success a little while ago.

    I'm trying to start over again from scratch but am now facing the below problem with qssl. I've found a "thread":http://qt-project.org/forums/viewthread/26154 where you also posted, so am currently looking into that.

    Thanks for your input. I'll post later :)

    ...
    qssl.cpp
    qsslcertificate.cpp
    d:\source\development\thirdparty\digia\qt5\qt5_rls_5-1-0\qtbase\src\network\ssl\qsslconfiguration_p.h(91) : error C2146: syntax error : missing ';' before identifier 'peerCertificate'
    d:\source\development\thirdparty\digia\qt5\qt5_rls_5-1-0\qtbase\src\network\ssl\qsslconfiguration_p.h(91) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    d:\source\development\thirdparty\digia\qt5\qt5_rls_5-1-0\qtbase\src\network\ssl\qsslconfiguration_p.h(92) : error C2065: 'QSslCertificate' : undeclared identifier
    ...
    d:\source\development\thirdparty\digia\qt5\qt5_rls_5-1-0\qtbase\include\qtnetwork\5.1.0\qtnetwork\private../../../../../src/network/ssl/qsslcontext_p.h(49) : fatal error C1083: Cannot open include file: 'openssl/ssl.h': No such file or directory
    ...


  • Lifetime Qt Champion

    It looks like you are missing the include path to openssl. Did you forgot to add the I and L parameters to point the additional folders when calling configure ?



  • In a way yes. I had written the openssl folder in the configure as well. Is now removed. However, calling configure like the below, gives me the following output. Is it OK that SSL is not mentioned? It seems to work, but I'm just wondering...

    Thank you very much for your help!

    Input:
    configure.bat -opensource -debug-and-release -nomake examples -nomake demos -openssl -I d:\source\development\thirdparty\openssl_release_0-9-8m-3\include -L d:\source\developm
    ent\thirdparty\openssl_release_0-9-8m-3\lib

    Output:
    ...
    Creating qmake...

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

    Running configuration tests...
    Environment:
    INCLUDE=
    C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\INCLUDE
    C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\ATLMFC\INCLUDE
    C:\Program Files (x86)\Windows Kits\8.0\include\shared
    C:\Program Files (x86)\Windows Kits\8.0\include\um
    C:\Program Files (x86)\Windows Kits\8.0\include\winrt

    LIB=
      C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\LIB
      C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\ATLMFC\LIB
      C:\Program Files (x86)\Windows Kits\8.0\lib\win8\um\x86

  • Lifetime Qt Champion

    You should have a look at the configuration log (just before it starts building qmake)

    It will show you whether SSL has been activated or not



  • @Hykkel I had configure with -I to include openssl include path, but it didn't show in the INCLUDE= after Running configuration tests.

    Any ideas why?


  • Lifetime Qt Champion

    @dscyw can you show the complete configure line as well as configure summary ?



  • @dscyw said in x86 build problem on x64 windows:

    @Hykkel I had configure with -I to include openssl include path, but it didn't show in the INCLUDE= after Running configuration tests.

    Any ideas why?

    To summary, my problem is that configure with openssl include path and libray path didn't work, and my build process got stuck in cann't open openssl/ssl.h.

    @SGaist
    Thanks for your reply.
    Configure line is

    configure.bat  -static -debug-and-release -prefix C:\Qt\Qt5.6.1_Static  -platform win32-msvc2010 -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -qt-sql-sqlite -qt-sql-odbc -openssl-linked OPENSSL_LIBS="-lssleay32 -llibeay32" -I C:\Libs\openssl_1.0.1j\include -L C:\Libs\openssl_1.0.1j\lib -opensource -confirm-license -make libs  -nomake examples -nomake tests
    

    Configure summary is

    Running configuration tests...
    Done running configuration tests.
    Environment:
    
        INCLUDE=
          C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE
          C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\ATLMFC\INCLUDE
          C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include
    
    LIB=
          C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\LIB\amd64
          C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\ATLMFC\LIB\amd64
          C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\x64
    
        PATH=
          C:\Program Files (x86)\Microsoft F#\v4.0\
          C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\
          C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\x86_amd64
          C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN
          C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools
          C:\Windows\Microsoft.NET\Framework\v4.0.30319
          C:\Windows\Microsoft.NET\Framework\v3.5
          C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\VCPackages
          C:\Program Files (x86)\HTML Help Workshop
          C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team 
    
    Tools\Performance
     Tools
          C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 
    Tools
          C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin
          C:\Python27\
          C:\Python27\Scripts
          C:\Perl64\site\bin
          C:\Perl64\bin
          C:\Windows\system32
          C:\Windows
          C:\Windows\System32\Wbem
          C:\Windows\System32\WindowsPowerShell\v1.0\
          C:\Program Files\Intel\WiFi\bin\
          C:\Program Files\Common Files\Intel\WirelessCommon\
          C:\Program Files (x86)\Common Files\lenovo\easyplussdk\bin
          C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\
          C:\Program Files\Microsoft SQL Server\100\Tools\Binn\
          C:\Program Files\Microsoft SQL Server\100\DTS\Binn\
          C:\Program Files\TortoiseSVN\bin
          C:\Qt\Tools\QtCreator\bin
          C:\Users\EShore\AppData\Local\nasm
          C:\Ruby23-x64\bin
          C:\Users\EShore\AppData\Roaming\Python\Scripts
    
    Configuration:
        precompile_header
        pcre
        debug
        compile_examples
    
    Qt Configuration:
        minimal-config
        small-config
        medium-config
        large-config
        full-config
        debug_and_release build_all release
        debug
        static
        zlib
        gif
        jpeg
        png
        freetype
        harfbuzz
        build_all
        accessibility
        opengl
        ssl
        openssl-linked
        dbus
        audio-backend
        directwrite
        native-gestures
        qpa
        concurrent
    
    QMAKESPEC...................win32-msvc2010 (commandline)
    Architecture................x86_64, features: sse sse2
    Host Architecture...........x86_64, features: sse sse2
    Maketool....................nmake
    Debug build.................yes (combined)
    Default build...............debug
    Force debug info............no
    Force optimized tools.......no
    C++ language standard.......auto
    Link Time Code Generation...no
    Using PCH ..................yes
    Accessibility support.......yes
    RTTI support................yes
    SSE2 support................yes
    SSE3 support................yes
    SSSE3 support...............yes
    SSE4.1 support..............yes
    SSE4.2 support..............yes
    AVX support.................yes
    AVX2 support................no
    NEON support................no
    OpenGL support..............yes
    Large File support..........yes
    NIS support.................no
    Iconv support...............no
    Evdev support...............no
    Mtdev support...............no
    Inotify support.............no
    eventfd(7) support..........no
    Glib support................no
    CUPS support................no
    OpenVG support..............no
    SSL support.................yes
    OpenSSL support.............linked
    libproxy support............no
    Qt D-Bus support............runtime
    Qt Widgets module support...yes
    Qt GUI module support.......yes
    QML debugging...............yes
    DirectWrite support.........yes
    Use system proxies..........no
    
    QPA Backends:
        GDI.....................yes
        Direct2D................no
    
    Third Party Libraries:
        ZLIB support............qt
        GIF support.............yes
        JPEG support............yes
        PNG support.............yes
        FreeType support........yes
        Fontconfig support......no
        HarfBuzz support........qt
        PCRE support............qt
        ICU support.............no
        ANGLE...................no
        Dynamic OpenGL..........no
    
    Styles:
        Windows.................yes
        Windows XP..............yes
        Windows Vista...........yes
        Fusion..................yes
        Windows CE..............no
        Windows Mobile..........no
    
    Sql Drivers:
        ODBC....................yes
        MySQL...................no
        OCI.....................no
        PostgreSQL..............no
        TDS.....................no
        DB2.....................no
        SQLite..................yes (qt)
        SQLite2.................no
        InterBase...............no
    
    Sources are in..............C:\Qt\qt-everywhere-opensource-src-5.6.1\qtbase
    Build is done in............C:\Qt\qt-everywhere-opensource-src-5.6.1\qtbase
    Install prefix..............C:\Qt\Qt5.6.1_Static
    Headers installed to........C:\Qt\Qt5.6.1_Static\include
    Libraries installed to......C:\Qt\Qt5.6.1_Static\lib
    Arch-dep. data to...........C:\Qt\Qt5.6.1_Static
    Plugins installed to........C:\Qt\Qt5.6.1_Static\plugins
    Library execs installed to..C:\Qt\Qt5.6.1_Static\bin
    QML1 imports installed to...C:\Qt\Qt5.6.1_Static\imports
    QML2 imports installed to...C:\Qt\Qt5.6.1_Static\qml
    Binaries installed to.......C:\Qt\Qt5.6.1_Static\bin
    Arch-indep. data to.........C:\Qt\Qt5.6.1_Static
    Docs installed to...........C:\Qt\Qt5.6.1_Static\doc
    Translations installed to...C:\Qt\Qt5.6.1_Static\translations
    Examples installed to.......C:\Qt\Qt5.6.1_Static\examples
    Tests installed to..........C:\Qt\Qt5.6.1_Static\tests
    Include paths...............C:\Libs\openssl_1.0.1j\include
    Additional libraries........-LC:\Libs\openssl_1.0.1j\lib
    WARNING: Using static linking will disable the use of plugins.
             Make sure you compile ALL needed modules into the library.
    

    Before I asked you for help, I overlooked the fact that openssl include path and library path had be added to my configure summary. But it didn't work either. I had try nmake clean and then reconfigure & nmake in vain.

    Please pay attention to
    Include paths...............C:\Libs\openssl_1.0.1j\include
    Additional libraries........-LC:\Libs\openssl_1.0.1j\lib

    at the bottom of the configure summary.

    Why doesn't it appear in INCLUDE and LIB at the top of configure summary. And why library path for openssl is prepended by -L?

    PS:
    The content of configure.bat from qt source code folder is

    set "srcpath=%~dp0"
    set "configure=%srcpath%qtbase\configure.bat"
    if not exist "%configure%" (
        echo %configure% not found. Did you forget to run "init-repository"? >&2
        exit /b 1
    )
    
    if not exist qtbase mkdir qtbase || exit /b 1
    
    echo + cd qtbase
    cd qtbase || exit /b 1
    
    echo + %configure% -top-level %*
    call %configure% -top-level %*
    set err=%errorlevel%
    
    cd ..
    
    exit /b %err%
    

  • Lifetime Qt Champion

    Might be a silly question but are you sure all your dependencies are built for the correct architecture ? Using the same compiler ?



  • @SGaist Maybe, but I didn't figure it out. I built the same source successfully without any errors a few days ago. This time I just added the openssl support and I built openssl successfully.



  • @dscyw said in x86 build problem on x64 windows:

    @dscyw said in x86 build problem on x64 windows:

    @Hykkel I had configure with -I to include openssl include path, but it didn't show in the INCLUDE= after Running configuration tests.

    Any ideas why?

    To summary, my problem is that configure with openssl include path and libray path didn't work, and my build process got stuck in cann't open openssl/ssl.h.

    @SGaist
    Thanks for your reply.
    Configure line is

    configure.bat  -static -debug-and-release -prefix C:\Qt\Qt5.6.1_Static  -platform win32-msvc2010 -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -qt-sql-sqlite -qt-sql-odbc -openssl-linked OPENSSL_LIBS="-lssleay32 -llibeay32" -I C:\Libs\openssl_1.0.1j\include -L C:\Libs\openssl_1.0.1j\lib -opensource -confirm-license -make libs  -nomake examples -nomake tests
    

    Configure summary is

    Running configuration tests...
    Done running configuration tests.
    Environment:
    
        INCLUDE=
          C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE
          C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\ATLMFC\INCLUDE
          C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include
    
    LIB=
          C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\LIB\amd64
          C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\ATLMFC\LIB\amd64
          C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\lib\x64
    
        PATH=
          C:\Program Files (x86)\Microsoft F#\v4.0\
          C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\
          C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\x86_amd64
          C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN
          C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools
          C:\Windows\Microsoft.NET\Framework\v4.0.30319
          C:\Windows\Microsoft.NET\Framework\v3.5
          C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\VCPackages
          C:\Program Files (x86)\HTML Help Workshop
          C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team 
    
    Tools\Performance
     Tools
          C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 
    Tools
          C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin
          C:\Python27\
          C:\Python27\Scripts
          C:\Perl64\site\bin
          C:\Perl64\bin
          C:\Windows\system32
          C:\Windows
          C:\Windows\System32\Wbem
          C:\Windows\System32\WindowsPowerShell\v1.0\
          C:\Program Files\Intel\WiFi\bin\
          C:\Program Files\Common Files\Intel\WirelessCommon\
          C:\Program Files (x86)\Common Files\lenovo\easyplussdk\bin
          C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\
          C:\Program Files\Microsoft SQL Server\100\Tools\Binn\
          C:\Program Files\Microsoft SQL Server\100\DTS\Binn\
          C:\Program Files\TortoiseSVN\bin
          C:\Qt\Tools\QtCreator\bin
          C:\Users\EShore\AppData\Local\nasm
          C:\Ruby23-x64\bin
          C:\Users\EShore\AppData\Roaming\Python\Scripts
    
    Configuration:
        precompile_header
        pcre
        debug
        compile_examples
    
    Qt Configuration:
        minimal-config
        small-config
        medium-config
        large-config
        full-config
        debug_and_release build_all release
        debug
        static
        zlib
        gif
        jpeg
        png
        freetype
        harfbuzz
        build_all
        accessibility
        opengl
        ssl
        openssl-linked
        dbus
        audio-backend
        directwrite
        native-gestures
        qpa
        concurrent
    
    QMAKESPEC...................win32-msvc2010 (commandline)
    Architecture................x86_64, features: sse sse2
    Host Architecture...........x86_64, features: sse sse2
    Maketool....................nmake
    Debug build.................yes (combined)
    Default build...............debug
    Force debug info............no
    Force optimized tools.......no
    C++ language standard.......auto
    Link Time Code Generation...no
    Using PCH ..................yes
    Accessibility support.......yes
    RTTI support................yes
    SSE2 support................yes
    SSE3 support................yes
    SSSE3 support...............yes
    SSE4.1 support..............yes
    SSE4.2 support..............yes
    AVX support.................yes
    AVX2 support................no
    NEON support................no
    OpenGL support..............yes
    Large File support..........yes
    NIS support.................no
    Iconv support...............no
    Evdev support...............no
    Mtdev support...............no
    Inotify support.............no
    eventfd(7) support..........no
    Glib support................no
    CUPS support................no
    OpenVG support..............no
    SSL support.................yes
    OpenSSL support.............linked
    libproxy support............no
    Qt D-Bus support............runtime
    Qt Widgets module support...yes
    Qt GUI module support.......yes
    QML debugging...............yes
    DirectWrite support.........yes
    Use system proxies..........no
    
    QPA Backends:
        GDI.....................yes
        Direct2D................no
    
    Third Party Libraries:
        ZLIB support............qt
        GIF support.............yes
        JPEG support............yes
        PNG support.............yes
        FreeType support........yes
        Fontconfig support......no
        HarfBuzz support........qt
        PCRE support............qt
        ICU support.............no
        ANGLE...................no
        Dynamic OpenGL..........no
    
    Styles:
        Windows.................yes
        Windows XP..............yes
        Windows Vista...........yes
        Fusion..................yes
        Windows CE..............no
        Windows Mobile..........no
    
    Sql Drivers:
        ODBC....................yes
        MySQL...................no
        OCI.....................no
        PostgreSQL..............no
        TDS.....................no
        DB2.....................no
        SQLite..................yes (qt)
        SQLite2.................no
        InterBase...............no
    
    Sources are in..............C:\Qt\qt-everywhere-opensource-src-5.6.1\qtbase
    Build is done in............C:\Qt\qt-everywhere-opensource-src-5.6.1\qtbase
    Install prefix..............C:\Qt\Qt5.6.1_Static
    Headers installed to........C:\Qt\Qt5.6.1_Static\include
    Libraries installed to......C:\Qt\Qt5.6.1_Static\lib
    Arch-dep. data to...........C:\Qt\Qt5.6.1_Static
    Plugins installed to........C:\Qt\Qt5.6.1_Static\plugins
    Library execs installed to..C:\Qt\Qt5.6.1_Static\bin
    QML1 imports installed to...C:\Qt\Qt5.6.1_Static\imports
    QML2 imports installed to...C:\Qt\Qt5.6.1_Static\qml
    Binaries installed to.......C:\Qt\Qt5.6.1_Static\bin
    Arch-indep. data to.........C:\Qt\Qt5.6.1_Static
    Docs installed to...........C:\Qt\Qt5.6.1_Static\doc
    Translations installed to...C:\Qt\Qt5.6.1_Static\translations
    Examples installed to.......C:\Qt\Qt5.6.1_Static\examples
    Tests installed to..........C:\Qt\Qt5.6.1_Static\tests
    Include paths...............C:\Libs\openssl_1.0.1j\include
    Additional libraries........-LC:\Libs\openssl_1.0.1j\lib
    WARNING: Using static linking will disable the use of plugins.
             Make sure you compile ALL needed modules into the library.
    

    Before I asked you for help, I overlooked the fact that openssl include path and library path had be added to my configure summary. But it didn't work either. I had try nmake clean and then reconfigure & nmake in vain.

    Please pay attention to
    Include paths...............C:\Libs\openssl_1.0.1j\include
    Additional libraries........-LC:\Libs\openssl_1.0.1j\lib

    at the bottom of the configure summary.

    Why doesn't it appear in INCLUDE and LIB at the top of configure summary. And why library path for openssl is prepended by -L?

    PS:
    The content of configure.bat from qt source code folder is

    set "srcpath=%~dp0"
    set "configure=%srcpath%qtbase\configure.bat"
    if not exist "%configure%" (
        echo %configure% not found. Did you forget to run "init-repository"? >&2
        exit /b 1
    )
    
    if not exist qtbase mkdir qtbase || exit /b 1
    
    echo + cd qtbase
    cd qtbase || exit /b 1
    
    echo + %configure% -top-level %*
    call %configure% -top-level %*
    set err=%errorlevel%
    
    cd ..
    
    exit /b %err%
    

    Maybe the previous build command is too long and some options conflicted. I checkout the source from git and built successfully with
    configure.bat -prefix C:\Qt\Qt570_Static -static -debug-and-release -openssl -I C:\Libs\openssl_1.0.1j\include -L C:\Libs\openssl_1.0.1j\lib -opensource -confirm-license -make libs -nomake examples -nomake tests via Visual Studio 2015.
    May it helps. Thank you all the same


  • Lifetime Qt Champion

    When you built Qt with VS2010, was OpenSSL also built with VS2010 ?



  • @SGaist Yes. Now I encountered a new problem, It will be great if you can give me some tips. Thanks in advance. https://forum.qt.io/topic/70878/how-to-use-qt5-static-library


Log in to reply
 

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