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 QT from source code statically to be used with Visual Studio
QtWS25 Last Chance

Building QT from source code statically to be used with Visual Studio

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
visual studiovisual c++static buildx64deployment
2 Posts 2 Posters 1.3k 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.
  • O Offline
    O Offline
    onat
    wrote on last edited by
    #1

    Hello,
    I am developing a QT application using Visual Studio. Since I want to create a standalone application that can be used without having to install DLL files, I have selected "Multi-threaded" instead of "Multi-threaded DLL" in the runtime library option in Visual Studio. However, this requires that I build all associated 3rd party libraries statically. I did some research and found helpful instructions here.
    http://amin-ahmadi.com/2016/09/22/how-to-build-qt-5-7-statically-using-msvc14-microsoft-visual-studio-2015/
    I followed all the instructions, but in the end I got the error "module machine type 'X86' conflicts with target machine type 'x64' ". I searched for the cause of this error and apparently the QT source code was built for an x86 platform. I found this by using the command

    ./dumpbin.exe "C:\Qt\Static\5.7.0\lib\Qt5Chartsd.lib" -he
    aders | findstr machine
    

    I am using Visual Studio 2015 Community on a 64-bit Windows 10 system. What do I need to do to build QT statically from the source code, so that it can be seamlessly used with Visual Studio on a 64 bit system.
    Thanks in advance.

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

      Hi,

      Use the amd64 command prompt when building Qt.

      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

      • Login

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