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. Unable to specify target architecture as x64 [Windows][Visual Studio 2015 compiler]

Unable to specify target architecture as x64 [Windows][Visual Studio 2015 compiler]

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 3 Posters 2.2k 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.
  • sanojsubranS Offline
    sanojsubranS Offline
    sanojsubran
    wrote on last edited by sanojsubran
    #1

    Hi,

    I am trying to compile a project from command line using, qmake and jom and I am getting error during compilation. But the same project compiles successfully, when done from Qt Creator. I am running the same commands, which are being shown in the 'compile' window in Qt Creator, but still it fails. On analyzing the compilation logs, I can see that some of the flags for cl.exe are not coming, when I run from the command line. Any help or pointers, will be highly appreciated.

    Error:

    link /NOLOGO /DYNAMICBASE /NXCOMPAT /INCREMENTAL:NO /DLL /SUBSYSTEM:WINDOWS /MANIFEST:embed /OUT:D:\all_files\work\projects\modelfactory.dll @C:\Users\john\AppData\Local\Temp\modelfactory.dll.5148.7098.jom
    libprotobuf.lib(generated_message_util.obj) : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'

    Compiler output from QtCreator

    cl -c -nologo -Zc:wchar_t -FS -Zc:strictStrings -Zc:throwingNew -O2 -MD -GR -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -EHsc -DUNICODE -DWIN32 -DWIN64 -DMODELFACTORY -DMODELFACTORY_LIBRARY -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DNDEBUG -ID:\all_files\work\projects\Parserlib -I. -I"C:\Program Files\CustomModule\lang\c++\protobuf3\include" -I"C:\Program Files\CustomModule\lang\c++\protobuf3\compiler" -I"C:\Program Files\CustomModule\lang\c++\CustomModule\include" -IC:\Qt\Qt5.7.0\5.7\msvc2015_64\include -IC:\Qt\Qt5.7.0\5.7\msvc2015_64\include\QtGui -IC:\Qt\Qt5.7.0\5.7\msvc2015_64\include\QtANGLE -IC:\Qt\Qt5.7.0\5.7\msvc2015_64\include\QtCore -Irelease -IC:\Qt\Qt5.7.0\5.7\msvc2015_64\mkspecs\win32-msvc2015 -Forelease\ @C:\Users\john\AppData\Local\Temp\cmodelfactory.obj.3644.109.jom

    Compiler output when run from command line

    cl -c -nologo -Zc:wchar_t -FS -Zc:strictStrings -Zc:throwingNew -O2 -MD -GR -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -EHsc -DUNICODE -DWIN32 -DMODELFACTORY -DMODELFACTORY_LIBRARY -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DNDEBUG -ID:\all_files\work\projects\Parserlib -I. -I"C:\Program Files\CustomModule\lang\c++\protobuf3\include" -I"C:\Program Files\CustomModule\lang\c++\protobuf3\compiler" -I"C:\Program Files\CustomModule\lang\c++\CustomModule\include" -IC:\Qt\Qt5.7.0\5.7\msvc2015_64\include -IC:\Qt\Qt5.7.0\5.7\msvc2015_64\include\QtGui -IC:\Qt\Qt5.7.0\5.7\msvc2015_64\include\QtANGLE -IC:\Qt\Qt5.7.0\5.7\msvc2015_64\include\QtCore -Irelease -IC:\Qt\Qt5.7.0\5.7\msvc2015_64\mkspecs\win32-msvc2015 -Forelease\ @C:\Users\john\AppData\Local\Temp\cmodelfactory.obj.10396.31.jom

    Missing params in command line

    -DWIN64

    Thanks in advance,
    Sanoj

    aha_1980A 1 Reply Last reply
    0
    • sanojsubranS sanojsubran

      Hi,

      I am trying to compile a project from command line using, qmake and jom and I am getting error during compilation. But the same project compiles successfully, when done from Qt Creator. I am running the same commands, which are being shown in the 'compile' window in Qt Creator, but still it fails. On analyzing the compilation logs, I can see that some of the flags for cl.exe are not coming, when I run from the command line. Any help or pointers, will be highly appreciated.

      Error:

      link /NOLOGO /DYNAMICBASE /NXCOMPAT /INCREMENTAL:NO /DLL /SUBSYSTEM:WINDOWS /MANIFEST:embed /OUT:D:\all_files\work\projects\modelfactory.dll @C:\Users\john\AppData\Local\Temp\modelfactory.dll.5148.7098.jom
      libprotobuf.lib(generated_message_util.obj) : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'

      Compiler output from QtCreator

      cl -c -nologo -Zc:wchar_t -FS -Zc:strictStrings -Zc:throwingNew -O2 -MD -GR -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -EHsc -DUNICODE -DWIN32 -DWIN64 -DMODELFACTORY -DMODELFACTORY_LIBRARY -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DNDEBUG -ID:\all_files\work\projects\Parserlib -I. -I"C:\Program Files\CustomModule\lang\c++\protobuf3\include" -I"C:\Program Files\CustomModule\lang\c++\protobuf3\compiler" -I"C:\Program Files\CustomModule\lang\c++\CustomModule\include" -IC:\Qt\Qt5.7.0\5.7\msvc2015_64\include -IC:\Qt\Qt5.7.0\5.7\msvc2015_64\include\QtGui -IC:\Qt\Qt5.7.0\5.7\msvc2015_64\include\QtANGLE -IC:\Qt\Qt5.7.0\5.7\msvc2015_64\include\QtCore -Irelease -IC:\Qt\Qt5.7.0\5.7\msvc2015_64\mkspecs\win32-msvc2015 -Forelease\ @C:\Users\john\AppData\Local\Temp\cmodelfactory.obj.3644.109.jom

      Compiler output when run from command line

      cl -c -nologo -Zc:wchar_t -FS -Zc:strictStrings -Zc:throwingNew -O2 -MD -GR -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -EHsc -DUNICODE -DWIN32 -DMODELFACTORY -DMODELFACTORY_LIBRARY -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DNDEBUG -ID:\all_files\work\projects\Parserlib -I. -I"C:\Program Files\CustomModule\lang\c++\protobuf3\include" -I"C:\Program Files\CustomModule\lang\c++\protobuf3\compiler" -I"C:\Program Files\CustomModule\lang\c++\CustomModule\include" -IC:\Qt\Qt5.7.0\5.7\msvc2015_64\include -IC:\Qt\Qt5.7.0\5.7\msvc2015_64\include\QtGui -IC:\Qt\Qt5.7.0\5.7\msvc2015_64\include\QtANGLE -IC:\Qt\Qt5.7.0\5.7\msvc2015_64\include\QtCore -Irelease -IC:\Qt\Qt5.7.0\5.7\msvc2015_64\mkspecs\win32-msvc2015 -Forelease\ @C:\Users\john\AppData\Local\Temp\cmodelfactory.obj.10396.31.jom

      Missing params in command line

      -DWIN64

      Thanks in advance,
      Sanoj

      aha_1980A Offline
      aha_1980A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi @sanojsubran,

      libprotobuf.lib(generated_message_util.obj) : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'

      Do you open a "Visual Studio Command Prompt"?

      • If yes, then you have to choose the correct one for 32 or 64 bit.
      • If no, then how do you specify the path to your compiler?

      Regards

      Qt has to stay free or it will die.

      sanojsubranS 1 Reply Last reply
      3
      • VRoninV Offline
        VRoninV Offline
        VRonin
        wrote on last edited by VRonin
        #3

        How do you call qmake from command line? It should look something like this:

        pushd C:\
        "C:/Qt/5.11.0/msvc2015_64/bin/qtenv2.bat"
        "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/vcvarsall.bat" amd64
        popd
        qmake
        nmake
        

        the amd64 argument to vcvarsall being the key here

        "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
        ~Napoleon Bonaparte

        On a crusade to banish setIndexWidget() from the holy land of Qt

        sanojsubranS 1 Reply Last reply
        3
        • aha_1980A aha_1980

          Hi @sanojsubran,

          libprotobuf.lib(generated_message_util.obj) : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'

          Do you open a "Visual Studio Command Prompt"?

          • If yes, then you have to choose the correct one for 32 or 64 bit.
          • If no, then how do you specify the path to your compiler?

          Regards

          sanojsubranS Offline
          sanojsubranS Offline
          sanojsubran
          wrote on last edited by
          #4

          @aha_1980 I was running from windows console. I was running vcvars32.bat file to set up the env variables.

          1 Reply Last reply
          1
          • VRoninV VRonin

            How do you call qmake from command line? It should look something like this:

            pushd C:\
            "C:/Qt/5.11.0/msvc2015_64/bin/qtenv2.bat"
            "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/vcvarsall.bat" amd64
            popd
            qmake
            nmake
            

            the amd64 argument to vcvarsall being the key here

            sanojsubranS Offline
            sanojsubranS Offline
            sanojsubran
            wrote on last edited by
            #5

            @VRonin It worked. Thanks a lot. :)

            1 Reply Last reply
            1

            • Login

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