Qt for Windows

From MythTV Official Wiki
Jump to: navigation, search


  • The version of Qt must match the version of Visual Studio used
  • Qt must include OpenGL support
  • Qt's bin directory must be added to the system path
  • MySQL support must be present (may need to be manually built from Qt source)

Installing Qt

Information.png Tip: You may be able to use the latest version of Qt. (Qt 5.3.1 has been tested successfully)

This guide used the Qt 5.1 Online Installer for Windows downloaded from:


It's important to select Source Components in order to build the MySQL driver. Make sure "msvc2010 32-bit OpenGL" and "Source Components" are checked.


Once installed, add the Qt bin directory to the system path.

MySQL Support

MythTV requires Qt's MySQL driver, but it is not provided pre-built. You will need to compile it from the source.

  1. Open a Visual Studio command prompt. In the Start menu, in the Visual Studio folder, select Visual Studio Command Prompt
  2. cd to c:\Qt\5.1.1\Src\qtbase\src\plugins\sqldrivers\mysql
  3. set the mysql environment variable to the mysql install directory in Program Files (x86) containing the bin directory. It's important to use the short file version of the directory names. For example:
    • set mysql=C:\PROGRA~2\MySQL\MYSQLS~1.6
  4. If you're not sure what the short form is for your directory, type dir /x, which will list long and short names together
  5. type qmake "INCLUDEPATH+=%mysql%\include" "LIBS+=%mysql%\lib\libmysql.lib" -o Makefile mysql.pro
  6. type nmake
  7. Copy qsqlmysql.dll and qsqlmysqld.dll from C:\Qt\Qt5.1.1\Sources\qtbase\plugins\sqldrivers to C:\Qt\5.1.1\msvc2010_opengl\plugins\sqldrivers
  8. Copy libmysql.dll from %mysql%\lib to C:\Windows. You will need administrator's right to do this.