How to compile qt source on Windows7 platform?

  • I want to compile qt5.3.1 source code with some changes. Actually, i want to compile qt like qt-opensource-windows-x86-mingw482_opengl-5.3.1.exe as official website shows. The point is that the specific constraint like mingw & opengl etc matter.

    Could anyone help me?

  • @dhuta
    You need to download the source package from here and the guidelines are here

    The exe you referring to is a precompiled version. It includes also source code, but it is recommended to use the pure source code package and start the compilation.

  • @koahnig

    i must use Visual Studio 2013? I just installed Visual Studio 2012. And when i run the .cmd as those steps show, there are errors like:

    NMAKE: fatal error U1077: "c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\cl.EXE": return code: "0xc1000135".
    Building qmake failed, return code 2.

    What's the reason? How to solve it?

  • @dhuta
    You may use basically any compiler suite, but you have to stay with it. Binaries of Qt libs of compiler versions are not compatible in general. When Visual Studio 2013 is used for compiling Qt libs, you can use those only for VS 2013, but not for any other version of VS. MinGW is different again.

  • Lifetime Qt Champion


    To add to @koahnig, it's not a Qt specific problem. Compilers on Windows are not compatible one with the other, so basically you have to ensure that all components of your software are built using the same compiler.