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. Building QMYSQL Plugin with nmake for msvc2017: module machine type 'x86' conflicts with target machine type 'x64'
Forum Updated to NodeBB v4.3 + New Features

Building QMYSQL Plugin with nmake for msvc2017: module machine type 'x86' conflicts with target machine type 'x64'

Scheduled Pinned Locked Moved Solved Installation and Deployment
33 Posts 3 Posters 3.0k 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.
  • O Offline
    O Offline
    obradley
    wrote on last edited by
    #7

    @jsulm said in Building QMYSQL Plugin with nmake for msvc2017: module machine type 'x86' conflicts with target machine type 'x64':

    x86_64 Qt

    I am using Qt version 5.14.2. As far as I can see from the page http://download.qt.io/archive/qt/5.14/5.14.2/ the only version available for Windows is for x86, at least for the installer. Should I change to a more recent version?

    1 Reply Last reply
    0
    • jsulmJ jsulm

      @obradley Do you really want/need to use x86 Qt build? If not simply install x86_64 Qt version.
      QtCompany does not provide recent Qt versions as x86 builds as far as I know, so if you would need a recent Qt version you would need to build it by yourself.

      O Offline
      O Offline
      obradley
      wrote on last edited by
      #8

      @jsulm said in Building QMYSQL Plugin with nmake for msvc2017: module machine type 'x86' conflicts with target machine type 'x64':

      If not simply install x86_64 Qt version.

      Update: I just ran qtdiag in the command prompt and it returned the following:

      qt.network.ssl: QSslSocket: cannot resolve SSL_CTX_set_ciphersuites
      qt.network.ssl: QSslSocket: cannot resolve SSL_set_psk_use_session_callback
      Qt 5.14.2 (i386-little_endian-ilp32 shared (dynamic) release build; by MSVC 2017) on "windows"
      OS: Windows 10 Version 1909 [winnt version 10.0.18363]
      
      Architecture: x86_64; features: SSE2 SSE3 SSSE3 SSE4.1 SSE4.2 AVX AVX2
      
      Environment:
        QtMsBuild="C:\Users\OBradley\AppData\Local\QtMsBuild"
      
      Features: QT_NO_EXCEPTIONS
      
      Library info:
        PrefixPath: C:\Qt\Qt5.14.2\5.14.2\msvc2017
        DocumentationPath: C:\Qt\Qt5.14.2\Docs\Qt-5.14.2
        HeadersPath: C:\Qt\Qt5.14.2\5.14.2\msvc2017\include
        LibrariesPath: C:\Qt\Qt5.14.2\5.14.2\msvc2017\lib
        LibraryExecutablesPath: C:\Qt\Qt5.14.2\5.14.2\msvc2017\bin
        BinariesPath: C:\Qt\Qt5.14.2\5.14.2\msvc2017\bin
        PluginsPath: C:\Qt\Qt5.14.2\5.14.2\msvc2017\plugins
        ImportsPath: C:\Qt\Qt5.14.2\5.14.2\msvc2017\imports
        Qml2ImportsPath: C:\Qt\Qt5.14.2\5.14.2\msvc2017\qml
        ArchDataPath: C:\Qt\Qt5.14.2\5.14.2\msvc2017
        DataPath: C:\Qt\Qt5.14.2\5.14.2\msvc2017
        TranslationsPath: C:\Qt\Qt5.14.2\5.14.2\msvc2017\translations
        ExamplesPath: C:\Qt\Qt5.14.2\Examples\Qt-5.14.2
        TestsPath: C:\Qt\Qt5.14.2\5.14.2\msvc2017\tests
        SettingsPath:
      

      which seems to suggest that I am already using the x86_64 build. Is this not compatible with the x64 build I have for the MySQL C connector?

      jsulmJ 1 Reply Last reply
      0
      • O obradley

        @jsulm said in Building QMYSQL Plugin with nmake for msvc2017: module machine type 'x86' conflicts with target machine type 'x64':

        If not simply install x86_64 Qt version.

        Update: I just ran qtdiag in the command prompt and it returned the following:

        qt.network.ssl: QSslSocket: cannot resolve SSL_CTX_set_ciphersuites
        qt.network.ssl: QSslSocket: cannot resolve SSL_set_psk_use_session_callback
        Qt 5.14.2 (i386-little_endian-ilp32 shared (dynamic) release build; by MSVC 2017) on "windows"
        OS: Windows 10 Version 1909 [winnt version 10.0.18363]
        
        Architecture: x86_64; features: SSE2 SSE3 SSSE3 SSE4.1 SSE4.2 AVX AVX2
        
        Environment:
          QtMsBuild="C:\Users\OBradley\AppData\Local\QtMsBuild"
        
        Features: QT_NO_EXCEPTIONS
        
        Library info:
          PrefixPath: C:\Qt\Qt5.14.2\5.14.2\msvc2017
          DocumentationPath: C:\Qt\Qt5.14.2\Docs\Qt-5.14.2
          HeadersPath: C:\Qt\Qt5.14.2\5.14.2\msvc2017\include
          LibrariesPath: C:\Qt\Qt5.14.2\5.14.2\msvc2017\lib
          LibraryExecutablesPath: C:\Qt\Qt5.14.2\5.14.2\msvc2017\bin
          BinariesPath: C:\Qt\Qt5.14.2\5.14.2\msvc2017\bin
          PluginsPath: C:\Qt\Qt5.14.2\5.14.2\msvc2017\plugins
          ImportsPath: C:\Qt\Qt5.14.2\5.14.2\msvc2017\imports
          Qml2ImportsPath: C:\Qt\Qt5.14.2\5.14.2\msvc2017\qml
          ArchDataPath: C:\Qt\Qt5.14.2\5.14.2\msvc2017
          DataPath: C:\Qt\Qt5.14.2\5.14.2\msvc2017
          TranslationsPath: C:\Qt\Qt5.14.2\5.14.2\msvc2017\translations
          ExamplesPath: C:\Qt\Qt5.14.2\Examples\Qt-5.14.2
          TestsPath: C:\Qt\Qt5.14.2\5.14.2\msvc2017\tests
          SettingsPath:
        

        which seems to suggest that I am already using the x86_64 build. Is this not compatible with the x64 build I have for the MySQL C connector?

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

        @obradley QtCreator does not matter at all here. What matters is Qt.

        Try to start from a clean source tree (without any build artefacts from your previous builds) with "x86 Native Tools Command Prompt for VS2017 and in x64_x86 Cross Tools Command Prompt".

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

        1 Reply Last reply
        0
        • O Offline
          O Offline
          obradley
          wrote on last edited by
          #10

          In order to be sure that there's no lingering dependency issues and a clean build environment I've uninstalled and re-installed both MySQL and Qt. My current SQL server version is 5.6.19 for an x64 architecture, and the C connector is 6.1.3 for x64. I'm reinstalling Qt 5.14.2 for x86_64. I'm then going to rerun the qmake process in x64_x86 Cross Tools Command Prompt. Is that correct?

          jsulmJ 1 Reply Last reply
          0
          • O obradley

            In order to be sure that there's no lingering dependency issues and a clean build environment I've uninstalled and re-installed both MySQL and Qt. My current SQL server version is 5.6.19 for an x64 architecture, and the C connector is 6.1.3 for x64. I'm reinstalling Qt 5.14.2 for x86_64. I'm then going to rerun the qmake process in x64_x86 Cross Tools Command Prompt. Is that correct?

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

            @obradley said in Building QMYSQL Plugin with nmake for msvc2017: module machine type 'x86' conflicts with target machine type 'x64':

            Cross Tools Command Prompt

            Not sure what you mean by "Cross Command"? Do you mean the Visual Studio command prompt? If so, then yes, that's what you should do.

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

            1 Reply Last reply
            0
            • O Offline
              O Offline
              obradley
              wrote on last edited by
              #12

              @obradley said in Building QMYSQL Plugin with nmake for msvc2017: module machine type 'x86' conflicts with target machine type 'x64':

              x64_x86 Cross Tools Command Prompt for VS2017

              Ok I've reinstalled both MySQL and Qt and have just repeated steps 1 and 2 in my original question but now inside x64_x86 Cross Tools Command Prompt for VS2017 only for the output to be:

              Running configuration tests...
              Checking for DB2 (IBM)... no
              Checking for InterBase... no
              Checking for MySQL... no
              Checking for OCI (Oracle)... no
              Checking for ODBC... yes
              Checking for PostgreSQL... no
              Checking for SQLite (version 2)... no
              Checking for TDS (Sybase)... no
              Done running configuration tests.
              
              [...]
              

              Should I try a different VS command prompt since it worked in x64 Native Tools Command Prompt for VS2017, or will that just cause the issue to repeat itself?

              jsulmJ 1 Reply Last reply
              0
              • O obradley

                @obradley said in Building QMYSQL Plugin with nmake for msvc2017: module machine type 'x86' conflicts with target machine type 'x64':

                x64_x86 Cross Tools Command Prompt for VS2017

                Ok I've reinstalled both MySQL and Qt and have just repeated steps 1 and 2 in my original question but now inside x64_x86 Cross Tools Command Prompt for VS2017 only for the output to be:

                Running configuration tests...
                Checking for DB2 (IBM)... no
                Checking for InterBase... no
                Checking for MySQL... no
                Checking for OCI (Oracle)... no
                Checking for ODBC... yes
                Checking for PostgreSQL... no
                Checking for SQLite (version 2)... no
                Checking for TDS (Sybase)... no
                Done running configuration tests.
                
                [...]
                

                Should I try a different VS command prompt since it worked in x64 Native Tools Command Prompt for VS2017, or will that just cause the issue to repeat itself?

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

                @obradley What does the config.log file says now?

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

                1 Reply Last reply
                0
                • O Offline
                  O Offline
                  obradley
                  wrote on last edited by
                  #14

                  I've pasted the contents of the log file below:

                  Command line: "MYSQL_INCDIR=C:/Program Files/MySQL/MySQL Connector C 6.1.3/include" "MYSQL_LIBDIR=C:/Program Files/MySQL/MySQL Connector C 6.1.3/lib"
                  Global lib dirs: [C:\\opensslx86\\lib C:\\Utils\\my_sql\\mysql-5.7.25-win32\\lib C:\\Utils\\postgresqlx86\\pgsql\\lib] ["C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.16.27023\\ATLMFC\\lib\\x86" "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.16.27023\\lib\\x86" "C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.6.1\\lib\\um\\x86" "C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.17763.0\\ucrt\\x86" "C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.17763.0\\um\\x86"]
                  Global inc dirs: [C:\\opensslx86\\include C:\\Utils\\my_sql\\mysql-5.7.25-win32\\include C:\\Utils\\postgresqlx86\\pgsql\\include] ["C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.16.27023\\ATLMFC\\include" "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.16.27023\\include" "C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.6.1\\include\\um" "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17763.0\\ucrt" "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17763.0\\shared" "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17763.0\\um" "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17763.0\\winrt" "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17763.0\\cppwinrt"]
                  looking for library db2
                  Trying source 0 (type inline) of library db2 ...
                  sqlcli.h not found in [] and global paths.
                  sqlcli1.h not found in [] and global paths.
                    => source produced no result.
                  Trying source 1 (type inline) of library db2 ...
                    => source failed condition '!config.win32'.
                  test config.sqldrivers.libraries.db2 FAILED
                  looking for library ibase
                  Trying source 0 (type inline) of library ibase ...
                  ibase.h not found in [] and global paths.
                    => source produced no result.
                  Trying source 1 (type inline) of library ibase ...
                    => source failed condition '!config.win32'.
                  test config.sqldrivers.libraries.ibase FAILED
                  looking for library mysql
                  Trying source 0 (type mysqlConfig) of library mysql ...
                  mysql_config not found.
                    => source produced no result.
                  Trying source 1 (type mysqlConfig) of library mysql ...
                  mysql_config not found.
                    => source produced no result.
                  Trying source 2 (type mysqlConfig) of library mysql ...
                  mysql_config not found.
                    => source produced no result.
                  Trying source 3 (type mysqlConfig) of library mysql ...
                  mysql_config not found.
                    => source produced no result.
                  Trying source 4 (type inline) of library mysql ...
                    => source failed condition '!config.win32'.
                  Trying source 5 (type inline) of library mysql ...
                  + cd /d C:\Qt\Qt5.14.2\5.14.2\Src\qtbase\src\plugins\sqldrivers\config.tests\mysql && C:\Qt\Qt5.14.2\5.14.2\msvc2017\bin\qmake.exe "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" "QMAKE_LIBDIR += C:\\opensslx86\\lib C:\\Utils\\my_sql\\mysql-5.7.25-win32\\lib C:\\Utils\\postgresqlx86\\pgsql\\lib" "INCLUDEPATH += C:\\opensslx86\\include C:\\Utils\\my_sql\\mysql-5.7.25-win32\\include C:\\Utils\\postgresqlx86\\pgsql\\include" "QMAKE_USE += mysql" "QMAKE_LIBS_MYSQL = \"-LC:/Program Files/MySQL/MySQL Connector C 6.1.3/lib\" -llibmysql" "QMAKE_INCDIR_MYSQL = \"C:/Program Files/MySQL/MySQL Connector C 6.1.3/include\"" C:/Qt/Qt5.14.2/5.14.2/Src/qtbase/src/plugins/sqldrivers/config.tests/mysql
                  > Info: creating stash file C:\Qt\Qt5.14.2\5.14.2\Src\qtbase\src\plugins\sqldrivers\config.tests\.qmake.stash
                  + cd /d C:\Qt\Qt5.14.2\5.14.2\Src\qtbase\src\plugins\sqldrivers\config.tests\mysql && set MAKEFLAGS=& nmake
                  > Microsoft (R) Program Maintenance Utility Version 14.16.27044.0
                  > Copyright (C) Microsoft Corporation.  All rights reserved.
                  > 	cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -O2 -MD -W0 -EHsc -DUNICODE -D_UNICODE -DWIN32 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DNDEBUG -I. -IC:\opensslx86\include -IC:\Utils\my_sql\mysql-5.7.25-win32\include -IC:\Utils\postgresqlx86\pgsql\include -I"C:\Program Files\MySQL\MySQL Connector C 6.1.3\include" -IC:\Qt\Qt5.14.2\5.14.2\msvc2017\mkspecs\win32-msvc -Fo @C:\Users\OLIVER~1\AppData\Local\Temp\nm9D9C.tmp
                  > main.cpp
                  > 	link /NOLOGO /DYNAMICBASE /NXCOMPAT /OPT:REF /INCREMENTAL:NO /SUBSYSTEM:CONSOLE "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /MANIFEST:embed /OUT:mysql.exe @C:\Users\OLIVER~1\AppData\Local\Temp\nmA08B.tmp
                  > main.obj : error LNK2019: unresolved external symbol _mysql_get_client_version@0 referenced in function _main
                  > C:\Program Files\MySQL\MySQL Connector C 6.1.3\lib\libmysql.lib : warning LNK4272: library machine type 'x64' conflicts with target machine type 'x86'
                  > mysql.exe : fatal error LNK1120: 1 unresolved externals
                  > NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x86\link.EXE"' : return code '0x460'
                  > Stop.
                   => source failed verification.
                  Trying source 6 (type inline) of library mysql ...
                    => source failed condition '!config.win32'.
                  test config.sqldrivers.libraries.mysql FAILED
                  looking for library oci
                  Trying source 0 (type inline) of library oci ...
                  oci.h not found in [] and global paths.
                    => source produced no result.
                  Trying source 1 (type inline) of library oci ...
                    => source failed condition '!config.win32'.
                  test config.sqldrivers.libraries.oci FAILED
                  looking for library odbc
                  Trying source 0 (type inline) of library odbc ...
                  + cd /d C:\Qt\Qt5.14.2\5.14.2\Src\qtbase\src\plugins\sqldrivers\config.tests\odbc && C:\Qt\Qt5.14.2\5.14.2\msvc2017\bin\qmake.exe "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" "QMAKE_LIBDIR += C:\\opensslx86\\lib C:\\Utils\\my_sql\\mysql-5.7.25-win32\\lib C:\\Utils\\postgresqlx86\\pgsql\\lib" "INCLUDEPATH += C:\\opensslx86\\include C:\\Utils\\my_sql\\mysql-5.7.25-win32\\include C:\\Utils\\postgresqlx86\\pgsql\\include" "QMAKE_USE += odbc" "QMAKE_LIBS_ODBC = -lodbc32" C:/Qt/Qt5.14.2/5.14.2/Src/qtbase/src/plugins/sqldrivers/config.tests/odbc
                  + cd /d C:\Qt\Qt5.14.2\5.14.2\Src\qtbase\src\plugins\sqldrivers\config.tests\odbc && set MAKEFLAGS=& nmake
                  > Microsoft (R) Program Maintenance Utility Version 14.16.27044.0
                  > Copyright (C) Microsoft Corporation.  All rights reserved.
                  > 	cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -O2 -MD -W0 -EHsc -DUNICODE -D_UNICODE -DWIN32 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DNDEBUG -I. -IC:\opensslx86\include -IC:\Utils\my_sql\mysql-5.7.25-win32\include -IC:\Utils\postgresqlx86\pgsql\include -IC:\Qt\Qt5.14.2\5.14.2\msvc2017\mkspecs\win32-msvc -Fo @C:\Users\OLIVER~1\AppData\Local\Temp\nmA4D0.tmp
                  > main.cpp
                  > 	link /NOLOGO /DYNAMICBASE /NXCOMPAT /OPT:REF /INCREMENTAL:NO /SUBSYSTEM:CONSOLE "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /MANIFEST:embed /OUT:odbc.exe @C:\Users\OLIVER~1\AppData\Local\Temp\nmA84B.tmp
                   => source accepted.
                  test config.sqldrivers.libraries.odbc succeeded
                  looking for library psql
                  Trying source 0 (type pkgConfig) of library psql ...
                  pkg-config use disabled globally.
                    => source produced no result.
                  Trying source 1 (type psqlConfig) of library psql ...
                  pg_config not found.
                    => source produced no result.
                  Trying source 2 (type psqlEnv) of library psql ...
                  libpq-fe.h not found in [] and global paths.
                    => source produced no result.
                  Trying source 3 (type psqlEnv) of library psql ...
                    => source failed condition '!config.win32'.
                  test config.sqldrivers.libraries.psql FAILED
                  looking for library sqlite2
                  Trying source 0 (type inline) of library sqlite2 ...
                  sqlite.h not found in [] and global paths.
                    => source produced no result.
                  test config.sqldrivers.libraries.sqlite2 FAILED
                  looking for library tds
                  Trying source 0 (type sybaseEnv) of library tds ...
                  + cd /d C:\Qt\Qt5.14.2\5.14.2\Src\qtbase\src\plugins\sqldrivers\config.tests\tds && C:\Qt\Qt5.14.2\5.14.2\msvc2017\bin\qmake.exe "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" "QMAKE_LIBDIR += C:\\opensslx86\\lib C:\\Utils\\my_sql\\mysql-5.7.25-win32\\lib C:\\Utils\\postgresqlx86\\pgsql\\lib" "INCLUDEPATH += C:\\opensslx86\\include C:\\Utils\\my_sql\\mysql-5.7.25-win32\\include C:\\Utils\\postgresqlx86\\pgsql\\include" "QMAKE_USE += tds" "QMAKE_LIBS_TDS = -lNTWDBLIB" C:/Qt/Qt5.14.2/5.14.2/Src/qtbase/src/plugins/sqldrivers/config.tests/tds
                  + cd /d C:\Qt\Qt5.14.2\5.14.2\Src\qtbase\src\plugins\sqldrivers\config.tests\tds && set MAKEFLAGS=& nmake
                  > Microsoft (R) Program Maintenance Utility Version 14.16.27044.0
                  > Copyright (C) Microsoft Corporation.  All rights reserved.
                  > 	cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -O2 -MD -W0 -EHsc -DUNICODE -D_UNICODE -DWIN32 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DNDEBUG -I. -IC:\opensslx86\include -IC:\Utils\my_sql\mysql-5.7.25-win32\include -IC:\Utils\postgresqlx86\pgsql\include -IC:\Qt\Qt5.14.2\5.14.2\msvc2017\mkspecs\win32-msvc -Fo @C:\Users\OLIVER~1\AppData\Local\Temp\nmAB87.tmp
                  > main.cpp
                  > .\main.cpp(2): fatal error C1083: Cannot open include file: 'sybfront.h': No such file or directory
                  > NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x86\cl.EXE"' : return code '0x2'
                  > Stop.
                   => source failed verification.
                  Trying source 1 (type sybaseEnv) of library tds ...
                    => source failed condition '!config.win32'.
                  test config.sqldrivers.libraries.tds FAILED
                  
                  jsulmJ 1 Reply Last reply
                  0
                  • O obradley

                    I've pasted the contents of the log file below:

                    Command line: "MYSQL_INCDIR=C:/Program Files/MySQL/MySQL Connector C 6.1.3/include" "MYSQL_LIBDIR=C:/Program Files/MySQL/MySQL Connector C 6.1.3/lib"
                    Global lib dirs: [C:\\opensslx86\\lib C:\\Utils\\my_sql\\mysql-5.7.25-win32\\lib C:\\Utils\\postgresqlx86\\pgsql\\lib] ["C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.16.27023\\ATLMFC\\lib\\x86" "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.16.27023\\lib\\x86" "C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.6.1\\lib\\um\\x86" "C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.17763.0\\ucrt\\x86" "C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.17763.0\\um\\x86"]
                    Global inc dirs: [C:\\opensslx86\\include C:\\Utils\\my_sql\\mysql-5.7.25-win32\\include C:\\Utils\\postgresqlx86\\pgsql\\include] ["C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.16.27023\\ATLMFC\\include" "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.16.27023\\include" "C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.6.1\\include\\um" "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17763.0\\ucrt" "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17763.0\\shared" "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17763.0\\um" "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17763.0\\winrt" "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17763.0\\cppwinrt"]
                    looking for library db2
                    Trying source 0 (type inline) of library db2 ...
                    sqlcli.h not found in [] and global paths.
                    sqlcli1.h not found in [] and global paths.
                      => source produced no result.
                    Trying source 1 (type inline) of library db2 ...
                      => source failed condition '!config.win32'.
                    test config.sqldrivers.libraries.db2 FAILED
                    looking for library ibase
                    Trying source 0 (type inline) of library ibase ...
                    ibase.h not found in [] and global paths.
                      => source produced no result.
                    Trying source 1 (type inline) of library ibase ...
                      => source failed condition '!config.win32'.
                    test config.sqldrivers.libraries.ibase FAILED
                    looking for library mysql
                    Trying source 0 (type mysqlConfig) of library mysql ...
                    mysql_config not found.
                      => source produced no result.
                    Trying source 1 (type mysqlConfig) of library mysql ...
                    mysql_config not found.
                      => source produced no result.
                    Trying source 2 (type mysqlConfig) of library mysql ...
                    mysql_config not found.
                      => source produced no result.
                    Trying source 3 (type mysqlConfig) of library mysql ...
                    mysql_config not found.
                      => source produced no result.
                    Trying source 4 (type inline) of library mysql ...
                      => source failed condition '!config.win32'.
                    Trying source 5 (type inline) of library mysql ...
                    + cd /d C:\Qt\Qt5.14.2\5.14.2\Src\qtbase\src\plugins\sqldrivers\config.tests\mysql && C:\Qt\Qt5.14.2\5.14.2\msvc2017\bin\qmake.exe "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" "QMAKE_LIBDIR += C:\\opensslx86\\lib C:\\Utils\\my_sql\\mysql-5.7.25-win32\\lib C:\\Utils\\postgresqlx86\\pgsql\\lib" "INCLUDEPATH += C:\\opensslx86\\include C:\\Utils\\my_sql\\mysql-5.7.25-win32\\include C:\\Utils\\postgresqlx86\\pgsql\\include" "QMAKE_USE += mysql" "QMAKE_LIBS_MYSQL = \"-LC:/Program Files/MySQL/MySQL Connector C 6.1.3/lib\" -llibmysql" "QMAKE_INCDIR_MYSQL = \"C:/Program Files/MySQL/MySQL Connector C 6.1.3/include\"" C:/Qt/Qt5.14.2/5.14.2/Src/qtbase/src/plugins/sqldrivers/config.tests/mysql
                    > Info: creating stash file C:\Qt\Qt5.14.2\5.14.2\Src\qtbase\src\plugins\sqldrivers\config.tests\.qmake.stash
                    + cd /d C:\Qt\Qt5.14.2\5.14.2\Src\qtbase\src\plugins\sqldrivers\config.tests\mysql && set MAKEFLAGS=& nmake
                    > Microsoft (R) Program Maintenance Utility Version 14.16.27044.0
                    > Copyright (C) Microsoft Corporation.  All rights reserved.
                    > 	cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -O2 -MD -W0 -EHsc -DUNICODE -D_UNICODE -DWIN32 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DNDEBUG -I. -IC:\opensslx86\include -IC:\Utils\my_sql\mysql-5.7.25-win32\include -IC:\Utils\postgresqlx86\pgsql\include -I"C:\Program Files\MySQL\MySQL Connector C 6.1.3\include" -IC:\Qt\Qt5.14.2\5.14.2\msvc2017\mkspecs\win32-msvc -Fo @C:\Users\OLIVER~1\AppData\Local\Temp\nm9D9C.tmp
                    > main.cpp
                    > 	link /NOLOGO /DYNAMICBASE /NXCOMPAT /OPT:REF /INCREMENTAL:NO /SUBSYSTEM:CONSOLE "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /MANIFEST:embed /OUT:mysql.exe @C:\Users\OLIVER~1\AppData\Local\Temp\nmA08B.tmp
                    > main.obj : error LNK2019: unresolved external symbol _mysql_get_client_version@0 referenced in function _main
                    > C:\Program Files\MySQL\MySQL Connector C 6.1.3\lib\libmysql.lib : warning LNK4272: library machine type 'x64' conflicts with target machine type 'x86'
                    > mysql.exe : fatal error LNK1120: 1 unresolved externals
                    > NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x86\link.EXE"' : return code '0x460'
                    > Stop.
                     => source failed verification.
                    Trying source 6 (type inline) of library mysql ...
                      => source failed condition '!config.win32'.
                    test config.sqldrivers.libraries.mysql FAILED
                    looking for library oci
                    Trying source 0 (type inline) of library oci ...
                    oci.h not found in [] and global paths.
                      => source produced no result.
                    Trying source 1 (type inline) of library oci ...
                      => source failed condition '!config.win32'.
                    test config.sqldrivers.libraries.oci FAILED
                    looking for library odbc
                    Trying source 0 (type inline) of library odbc ...
                    + cd /d C:\Qt\Qt5.14.2\5.14.2\Src\qtbase\src\plugins\sqldrivers\config.tests\odbc && C:\Qt\Qt5.14.2\5.14.2\msvc2017\bin\qmake.exe "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" "QMAKE_LIBDIR += C:\\opensslx86\\lib C:\\Utils\\my_sql\\mysql-5.7.25-win32\\lib C:\\Utils\\postgresqlx86\\pgsql\\lib" "INCLUDEPATH += C:\\opensslx86\\include C:\\Utils\\my_sql\\mysql-5.7.25-win32\\include C:\\Utils\\postgresqlx86\\pgsql\\include" "QMAKE_USE += odbc" "QMAKE_LIBS_ODBC = -lodbc32" C:/Qt/Qt5.14.2/5.14.2/Src/qtbase/src/plugins/sqldrivers/config.tests/odbc
                    + cd /d C:\Qt\Qt5.14.2\5.14.2\Src\qtbase\src\plugins\sqldrivers\config.tests\odbc && set MAKEFLAGS=& nmake
                    > Microsoft (R) Program Maintenance Utility Version 14.16.27044.0
                    > Copyright (C) Microsoft Corporation.  All rights reserved.
                    > 	cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -O2 -MD -W0 -EHsc -DUNICODE -D_UNICODE -DWIN32 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DNDEBUG -I. -IC:\opensslx86\include -IC:\Utils\my_sql\mysql-5.7.25-win32\include -IC:\Utils\postgresqlx86\pgsql\include -IC:\Qt\Qt5.14.2\5.14.2\msvc2017\mkspecs\win32-msvc -Fo @C:\Users\OLIVER~1\AppData\Local\Temp\nmA4D0.tmp
                    > main.cpp
                    > 	link /NOLOGO /DYNAMICBASE /NXCOMPAT /OPT:REF /INCREMENTAL:NO /SUBSYSTEM:CONSOLE "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /MANIFEST:embed /OUT:odbc.exe @C:\Users\OLIVER~1\AppData\Local\Temp\nmA84B.tmp
                     => source accepted.
                    test config.sqldrivers.libraries.odbc succeeded
                    looking for library psql
                    Trying source 0 (type pkgConfig) of library psql ...
                    pkg-config use disabled globally.
                      => source produced no result.
                    Trying source 1 (type psqlConfig) of library psql ...
                    pg_config not found.
                      => source produced no result.
                    Trying source 2 (type psqlEnv) of library psql ...
                    libpq-fe.h not found in [] and global paths.
                      => source produced no result.
                    Trying source 3 (type psqlEnv) of library psql ...
                      => source failed condition '!config.win32'.
                    test config.sqldrivers.libraries.psql FAILED
                    looking for library sqlite2
                    Trying source 0 (type inline) of library sqlite2 ...
                    sqlite.h not found in [] and global paths.
                      => source produced no result.
                    test config.sqldrivers.libraries.sqlite2 FAILED
                    looking for library tds
                    Trying source 0 (type sybaseEnv) of library tds ...
                    + cd /d C:\Qt\Qt5.14.2\5.14.2\Src\qtbase\src\plugins\sqldrivers\config.tests\tds && C:\Qt\Qt5.14.2\5.14.2\msvc2017\bin\qmake.exe "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" "QMAKE_LIBDIR += C:\\opensslx86\\lib C:\\Utils\\my_sql\\mysql-5.7.25-win32\\lib C:\\Utils\\postgresqlx86\\pgsql\\lib" "INCLUDEPATH += C:\\opensslx86\\include C:\\Utils\\my_sql\\mysql-5.7.25-win32\\include C:\\Utils\\postgresqlx86\\pgsql\\include" "QMAKE_USE += tds" "QMAKE_LIBS_TDS = -lNTWDBLIB" C:/Qt/Qt5.14.2/5.14.2/Src/qtbase/src/plugins/sqldrivers/config.tests/tds
                    + cd /d C:\Qt\Qt5.14.2\5.14.2\Src\qtbase\src\plugins\sqldrivers\config.tests\tds && set MAKEFLAGS=& nmake
                    > Microsoft (R) Program Maintenance Utility Version 14.16.27044.0
                    > Copyright (C) Microsoft Corporation.  All rights reserved.
                    > 	cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -O2 -MD -W0 -EHsc -DUNICODE -D_UNICODE -DWIN32 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DNDEBUG -I. -IC:\opensslx86\include -IC:\Utils\my_sql\mysql-5.7.25-win32\include -IC:\Utils\postgresqlx86\pgsql\include -IC:\Qt\Qt5.14.2\5.14.2\msvc2017\mkspecs\win32-msvc -Fo @C:\Users\OLIVER~1\AppData\Local\Temp\nmAB87.tmp
                    > main.cpp
                    > .\main.cpp(2): fatal error C1083: Cannot open include file: 'sybfront.h': No such file or directory
                    > NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x86\cl.EXE"' : return code '0x2'
                    > Stop.
                     => source failed verification.
                    Trying source 1 (type sybaseEnv) of library tds ...
                      => source failed condition '!config.win32'.
                    test config.sqldrivers.libraries.tds FAILED
                    
                    jsulmJ Offline
                    jsulmJ Offline
                    jsulm
                    Lifetime Qt Champion
                    wrote on last edited by
                    #15

                    @obradley said in Building QMYSQL Plugin with nmake for msvc2017: module machine type 'x86' conflicts with target machine type 'x64':

                    C:\Program Files\MySQL\MySQL Connector C 6.1.3\lib\libmysql.lib : warning LNK4272: library machine type 'x64' conflicts with target machine type 'x86'

                    You're still mixing x86 and x86_64. I think C:\Program Files\MySQL\MySQL Connector C 6.1.3\lib\libmysql.lib is x86 and not x86_64.

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

                    1 Reply Last reply
                    0
                    • O Offline
                      O Offline
                      obradley
                      wrote on last edited by
                      #16

                      So I should build with the 86 bit VS command prompt? Apologies for the confusion it's my first time encountering these types of issues

                      jsulmJ 1 Reply Last reply
                      0
                      • O obradley

                        So I should build with the 86 bit VS command prompt? Apologies for the confusion it's my first time encountering these types of issues

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

                        @obradley You should build what you want to have. If you need x86_64 build then install x86_64 MySQL Connector version.

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

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

                          Hi,

                          No, you should have your dependencies built for the same architecture are Qt. If you have a 64bit Qt then you need the 64bit version of the connector. There's no way to mix and match libraries built for different architectures.

                          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
                          • O Offline
                            O Offline
                            obradley
                            wrote on last edited by
                            #19

                            Sorry I'm still confused about. The connector I have is x64 according to MySQL installer. The installer which I have for Qt is an x86 installer. Running Qt diag returns that the architechture is x86_64. So does this mean I can use the 64 bit MySQL connector? So instead of running the x64_x86 Cross Tools Command Prompt for VS2017 should I run the x86_x64 Cross Tools Command Prompt for VS2017? This would be an environment initialised for x86_x64? Or do I instead need to find an x86 version of the C connector?

                            Apologies again for the confusion.

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

                              The architecture of the installer has nothing to do with the architecture of the Qt versions you installed. The same goes for Qt Creator, it can be x86 or x86_64, it does not matter when it comes to the architecture of the libraries you are using to build your application.

                              There's no cross-compilation going on: if you have everything as x86_64, just use the 64bit compiler.

                              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
                              1
                              • O Offline
                                O Offline
                                obradley
                                wrote on last edited by
                                #21

                                @SGaist said in Building QMYSQL Plugin with nmake for msvc2017: module machine type 'x86' conflicts with target machine type 'x64':

                                just use the 64bit compiler.

                                Ok I'm now getting an error : NMAKE : fatal error U1073: don't know how to make 'install'

                                jsulmJ 1 Reply Last reply
                                0
                                • O obradley

                                  @SGaist said in Building QMYSQL Plugin with nmake for msvc2017: module machine type 'x86' conflicts with target machine type 'x64':

                                  just use the 64bit compiler.

                                  Ok I'm now getting an error : NMAKE : fatal error U1073: don't know how to make 'install'

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

                                  @obradley Did you call nmake before? Please provide more information.

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

                                  1 Reply Last reply
                                  0
                                  • O Offline
                                    O Offline
                                    obradley
                                    wrote on last edited by
                                    #23

                                    I repeated steps 1 through 3 in my original question, so the nmake install error is happening after the configuration for mySql from qmake returns a "yes". I go into the sqldrivers\mysql folder and run "nmake install" like it says to do in the documentation.

                                    1 Reply Last reply
                                    0
                                    • O Offline
                                      O Offline
                                      obradley
                                      wrote on last edited by
                                      #24

                                      Ok calling nmake in the sqldrivers directory after configuration is still giving the "Qt5Sql.lib(Qt5Sql.dll) : fatal error LNK1112: module machine type 'x86' conflicts with target machine type 'x64'" error even though I am using the 64 bit compiler? (According to Microsoft docs the x64 Native Tools Command Prompt for VS 2017 does use the 64 bit compiler https://docs.microsoft.com/en-us/cpp/build/how-to-enable-a-64-bit-visual-cpp-toolset-on-the-command-line?view=msvc-160)

                                      If the connector is 64 bit and Qt is x86_64 then I still don't understand why I can't build in the 64 bit compiler.

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

                                        How exactly are you opening/configuring the command line ?

                                        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
                                        • O Offline
                                          O Offline
                                          obradley
                                          wrote on last edited by
                                          #26

                                          Thanks jsulm and SGaist for your help with this. Before I explain about the command line, I just want to quickly summarise progress so far.

                                          I've tried reinstalling Qt and MySql to ensure that they both have the same architecture:

                                          • For Qt, based on Jsulm's comment above and the fact that Qt's installer doesn't ask which architechture to use, I am assuming I have installled Qt 5.14.2 x64.

                                          • For mySql, according to Qt's instructions, since I have x64 Qt installed, I need the x64 mySql C connector, and no other components of the MySql installation are relevant for building the qmysql plugin. Having now played around with the MySql installer, depending on which C connector I install, I get a different error at the nmake stage of building the plugin.

                                          This is what I see when I run the MySql installer. It doesn't allow me to simultaneously install the 32 and 64 bit C connectors:

                                          ad8d1f57-309c-49b8-8b91-970af5df26dd-image.png

                                          When I have the 32 bit C connector installed (as shown in the screenshot above), the following qmake command runs fine:

                                          qmake -- MYSQL_INCDIR="C:\Program Files (x86)\MySQL\MySQL Connector C 6.1.3\include" MYSQL_LIBDIR="C:\Program Files (x86)\MySQL\MySQL Connector C 6.1.3\lib"
                                          

                                          However, when I then run nmake sub-mysql, nmake complains:

                                          NMAKE : fatal error U1073: don't know how to make '"C:\Program Files\MySQL\MySQL Connector C 6.1.3\include\mysql.h"'
                                          

                                          This makes sense because I have x64 bit qt installed, but qmake and nmake are being given the path to the 32 bit version of the C connector.

                                          When I have the 64 bit C connector installed, I run the following qmake command:

                                          qmake -- MYSQL_INCDIR="C:\Program Files\MySQL\MySQL Connector C 6.1.3\include" MYSQL_LIBDIR="C:\Program Files\MySQL\MySQL Connector C 6.1.3\lib"
                                          

                                          Now when I run nmake sub-mysql, I get the error reported at the beginning of this thread:

                                          Qt5Sql.lib(Qt5Sql.dll) : fatal error LNK1112: module machine type 'x86' conflicts with target machine type 'x64'
                                          

                                          The point of the above explanation is that nmake gives me a different error depending on whether I have the 32 bit or 64 bit mySql C connector installed, which means that I can be fairly confident that I have the 64 bit version of both MySql C connector and Qt based on the error messages that I am seeing from nmake.

                                          Visual Studio 2017 includes four different command prompts in which I can execute qmake and nmake:

                                          • x86 Native Tools Command Prompt for VS 2017
                                          • x64 Native Tools Command Prompt for VS 2017
                                          • x64_x86 Cross Tools Command Prompt for VS 2017
                                          • x86_x64 Cross Tools Command Prompt for VS 2017

                                          When I run qmake and nmake using the above commands in each of these four prompts, the error messages are the same as above , with one exception: when I call qmake for the 32 bit mySql driver in the 64 bit command prompts, or vice versa, qmake does not recognise that mySql has been configured at all when it gives the list of database drivers available.

                                          So in summary, whichever version of the MySql C connector I have installed, and whichever version of the command prompt I use, I always get the same errors.

                                          Thanks to you both again for your help with this issue, it is much appreciated.

                                          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