MythTV on Windows using Visual Studio

From MythTV Official Wiki
Revision as of 20:26, 9 September 2013 by Dblain (talk | contribs) (Building MythTV)

Jump to: navigation, search


As of MythTV version 0.28, you can use Microsoft Visual Studio 2010 or greater to build a native Win32 version of all main components (plugins are still not available as of writing this).

This guide will provide you with the steps needed to install all required tools and to perform a full compile of the MythTV source code.


Information.png Tip: The version of Visual Studio referenced in this guide is 2010, however we will try to make sure any newer version also works.


Requirements

The following tools must be installed in order to build the source. Some of the tools require specific settings or post install steps to be successfully used. Please follow each link to see detailed instructions that that component.


Information.png Tip: If a link isn't provided, it is assumed the default install will work as expected

Get the Source

You will need to clone the git source tree.

Open a "Visual Studio Command Prompt (2010)" and navigate to where you want the source located. This guild will assume it's located in c:\source.

To clone the source from github execute the following:

git clone git://github.com/MythTV/mythtv.git

This should place the source code in c:\source\mythtv

Information about Configure

There is a PowerShell script (configure.ps1) that is used to make sure your build environment is setup correctly. It also compiles third party dependencies that are needed for MythTV.

Configure can produce two types of output

  • Makefiles
  • Visual Studio Solution/Project files (mostly used for debugging with Visual Studio)

Makefiles

This is the best choice if you are looking for a simple way to quickly compile all code. It is completely command line driven and when finished, you will have all needed dll's & exe's.

Visual Studio Solution/Projects

Best used if you want to debug or develop code. It creates a set of solution and project files. You can then open the solution file in Visual Studio and use the full features of the tool.


Information.png Tip: You can run configure multiple times to produce both the makefiles and the Visual Studio Solution. You can then run the build on the command line at any time and switch to the IDE if you need to debug something.

Command Line Options

-BuildType

  • debug
  • release
  • clean

-OutputType

  • nmake
  • sln

Running Configure

To prepare to run configure, perform the following steps:

  1. Open a Visual Studio Command Prompt (2010)
  2. Change to the MythTV source directory which contains configure.ps1 (c:\source\mythtv\mythtv)
  3. execute: Powershell (this will allow you to run the script directly)

The above should leave you in a powershell command prompt in the source directory. Now you want to run configure.

Makefiles

.\configure -BuildType debug -OutputType nmake

Visual Studio Solution

.\configure -BuildType debug -OutputType sln

Warning.png Warning: First time running configure will cause dependencies to be compiled, including FFmpeg. This will take some time.

If all is going well the output should look something like the following the fist time running configure:

Win32-Configure-FirstTime.png

When Completed you should see:

Win32-Configure-Completed.png

Building MythTV

At this point, if you generated a Visual Studio Solution file, it is located in the same directory as the configure script. Just open it in Visual Studio.

C:\Source\mythtv\mythtv\mythtv.sln

If you choose to generate makefiles, all you need to do is execute:

PS C:\source\mythtv\mythtv> nmake

When Completed, the Executables and DLL's will be located in

C:\source\mythtv\mythtv\bin\debug\
              - or -
C:\source\mythtv\mythtv\bin\release\

Running MythTV

Incomplete.png Incomplete, needs to be expanded. Please help to fill the gaps or discuss the issue on the talk page

Problems You May Encounter

Incomplete.png Incomplete, needs to be expanded. Please help to fill the gaps or discuss the issue on the talk page

Some potential topics:

  • Permission issues in Powershell (Set-ExecutionPolicy)
as Admin: Set-ExecutionPolicy RemoteSigned -Scope LocalMachine
  • libmysql.dll not in path
  • Timezone tables in database
  • mythconverg not created