Difference between revisions of "MythTV on Windows using Visual Studio"
(→Problems You May Encounter) |
Stevegoodey (talk | contribs) m (→Visual Studio Solution: Typo) |
||
(9 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
[[Category:Developer Documentation]] | [[Category:Developer Documentation]] | ||
− | As of MythTV version 0.28, you can use Microsoft Visual Studio 2010 or | + | As of MythTV version 0.28, you can use Microsoft Visual Studio 2010 (or Visual Studio Express) 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. | 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. | ||
− | {{Tip box|The version of Visual Studio referenced in this guide is 2010, | + | {{Tip box|The version of Visual Studio referenced in this guide is 2010. Due to Qt incompatibilities, newer versions are currently unsupported}} |
== Requirements == | == 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 | + | 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 for that component. |
{{Tip box|If a link isn't provided, it is assumed the default install will work as expected}} | {{Tip box|If a link isn't provided, it is assumed the default install will work as expected}} | ||
− | :* Visual Studio 2010 or | + | :* MythTV and the associated dependencies must be compiled as 32-bit applications/dlls/libs, as Visual Studio does not support inline assembly when compiling for 64-bit targets |
− | :* [[ | + | :* Visual Studio. There is no 32-bit version of Qt with OpenGL for Visual Studio 2012, so Visual Studio 2010 or Visual Studio Express for C++ 2010 must be used. Visual Studio Express for C++ 2010 can be found here: :http://www.microsoft.com/visualstudio/eng/products/visual-studio-2010-express |
− | :* | + | :* [[MySQL for Windows]] |
+ | :* [[Qt for Windows]] | ||
:* [[Git for Windows]] | :* [[Git for Windows]] | ||
:* [[CMake]] | :* [[CMake]] | ||
Line 26: | Line 27: | ||
You will need to clone the git source tree. | 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 | + | Open a "Visual Studio Command Prompt (2010)" and navigate to where you want the source located. This guide will assume it's located in <tt>c:\source</tt>. |
To clone the source from github execute the following: | To clone the source from github execute the following: | ||
:<pre>git clone git://github.com/MythTV/mythtv.git</pre> | :<pre>git clone git://github.com/MythTV/mythtv.git</pre> | ||
− | |||
This should place the source code in <tt>c:\source\mythtv</tt> | This should place the source code in <tt>c:\source\mythtv</tt> | ||
Line 81: | Line 81: | ||
{{Warning box|First time running configure will cause dependencies to be compiled, including FFmpeg. This will take some time.}} | {{Warning box|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 | + | If all is going well the output should look something like the following the first time running configure: |
[[File:Win32-Configure-FirstTime.png]] | [[File:Win32-Configure-FirstTime.png]] | ||
Line 104: | Line 104: | ||
- or - | - or - | ||
C:\source\mythtv\mythtv\bin\release\</pre> | C:\source\mythtv\mythtv\bin\release\</pre> | ||
+ | |||
+ | == Running MythTV == | ||
+ | |||
+ | #If you are running the MythTV database on this system, you need to initialize the database. Follow these steps: | ||
+ | ##Create the mythconverg database by directing the mc.sql file into mysql.exe. For the installation in this guide, enter the following lines: | ||
+ | ##:*cd c:\Program Files (x86)\MySQL\MySQL Server 5.6\bin | ||
+ | ##:*mysql -u root -p < c:\source\mythtv\mythtv\database\mc.sql | ||
+ | ##Load time zone data for MySQL on Windows | ||
+ | ##:*Follow the guide on this web site: http://www.geeksengine.com/article/populate-time-zone-data-for-mysql.html. However, where it says to copy the files to the data directory in Program Files\MySQL, instead copy them to the data directory under ProgramData\MySQL. | ||
+ | #For now, you will need to copy the themes directory to a location under the myth bin directory: | ||
+ | #:*mkdir c:\source\mythtv\mythtv\bin\debug\share\mythtv | ||
+ | #:*xcopy c:\source\mythtv\mythtv\themes c:\source\mythtv\mythtv\bin\debug\share\mythtv\themes\ /e | ||
+ | |||
+ | {{Incomplete}} | ||
== Problems You May Encounter == | == Problems You May Encounter == | ||
Line 115: | Line 129: | ||
:* Timezone tables in database | :* Timezone tables in database | ||
:* mythconverg not created | :* mythconverg not created | ||
+ | :* FFmpeg can't find inttypes.h. See this link for the solution: [http://stackoverflow.com/questions/13266868/ffmpeg-inttypes-h-not-found-error inttypes.h missing] | ||
+ | :* If for some reason MSYS isn't found, delete everything between the brackets of "Function FindMSys()" and change the configure.ps1 file for MSYS as follows (changing your install path as needed): | ||
+ | $MSysPath = "C:\MinGW\" | ||
+ | $MSysPath += "msys\1.0\" | ||
+ | if ( Which( $MSysPath + "msys.bat" )) | ||
+ | { | ||
+ | return $MSysPath | ||
+ | } |
Latest revision as of 14:35, 25 October 2013
As of MythTV version 0.28, you can use Microsoft Visual Studio 2010 (or Visual Studio Express) 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.
Tip: The version of Visual Studio referenced in this guide is 2010. Due to Qt incompatibilities, newer versions are currently unsupported
Contents
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 for that component.
- MythTV and the associated dependencies must be compiled as 32-bit applications/dlls/libs, as Visual Studio does not support inline assembly when compiling for 64-bit targets
- Visual Studio. There is no 32-bit version of Qt with OpenGL for Visual Studio 2012, so Visual Studio 2010 or Visual Studio Express for C++ 2010 must be used. Visual Studio Express for C++ 2010 can be found here: :http://www.microsoft.com/visualstudio/eng/products/visual-studio-2010-express
- MySQL for Windows
- Qt for Windows
- Git for Windows
- CMake
- MSYS/MinGW
- YASM & NASM
- c99wrap
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 guide 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.
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:
- Open a Visual Studio Command Prompt (2010)
- Change to the MythTV source directory which contains configure.ps1 (c:\source\mythtv\mythtv)
- 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: 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 first time running configure:
When Completed you should see:
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
- If you are running the MythTV database on this system, you need to initialize the database. Follow these steps:
- Create the mythconverg database by directing the mc.sql file into mysql.exe. For the installation in this guide, enter the following lines:
- cd c:\Program Files (x86)\MySQL\MySQL Server 5.6\bin
- mysql -u root -p < c:\source\mythtv\mythtv\database\mc.sql
- Load time zone data for MySQL on Windows
- Follow the guide on this web site: http://www.geeksengine.com/article/populate-time-zone-data-for-mysql.html. However, where it says to copy the files to the data directory in Program Files\MySQL, instead copy them to the data directory under ProgramData\MySQL.
- Create the mythconverg database by directing the mc.sql file into mysql.exe. For the installation in this guide, enter the following lines:
- For now, you will need to copy the themes directory to a location under the myth bin directory:
- mkdir c:\source\mythtv\mythtv\bin\debug\share\mythtv
- xcopy c:\source\mythtv\mythtv\themes c:\source\mythtv\mythtv\bin\debug\share\mythtv\themes\ /e
Incomplete, needs to be expanded. Please help to fill the gaps or discuss the issue on the talk page
Problems You May Encounter
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
- FFmpeg can't find inttypes.h. See this link for the solution: inttypes.h missing
- If for some reason MSYS isn't found, delete everything between the brackets of "Function FindMSys()" and change the configure.ps1 file for MSYS as follows (changing your install path as needed):
$MSysPath = "C:\MinGW\" $MSysPath += "msys\1.0\" if ( Which( $MSysPath + "msys.bat" )) { return $MSysPath }