Difference between revisions of "MythTV on Windows"

From MythTV Official Wiki
Jump to: navigation, search
(QT: Added comment about requiring msys in path)
(Problems others have encountered: Comment about libqt-mt3.dll going into %QTDIR\bin)
Line 586: Line 586:
 
Solution:
 
Solution:
 
   Nasty hack. I copied it from %QTDIR%\lib to C:\WINDOWS\system32
 
   Nasty hack. I copied it from %QTDIR%\lib to C:\WINDOWS\system32
 +
  My QT build seems to copy it into %QTDIR\bin --zack

Revision as of 13:33, 27 December 2007

Summary

A Windows port of MythTV is in-the-works, using MinGW as the build platform, and MS Direct3D as the display layer. The frontend compiles, and most basic functionality works, but it crashes regularly. The patches are currently working their way into SVN, so check the -dev list, and Trac for the current state. Once the frontend is reliable, we can start to see about getting the changes necessary to get MythBackend to run.

Background & Caveats

Cygwin was previously a limiting factor as it introduced a dependency on cygwin1.dll. We have moved to MinGW, which compiles all the necessary functions statically, rather than linked in through a separate dll.

Please start by reading this link: http://mythtv.org/pipermail/mythtv-dev/2007-December/058662.html

the Trac reference is here: http://svn.mythtv.org/trac/ticket/4270

MinGW/GCC doesn't seem to work well under Vista 64 bit (maybe even 32 bit too). Try compiling on an 2000/XP box instead.

HOWTO - A WORK IN PROGRESS

1 - Install MinGW - download the "Automated MinGW Installer".

 homepage:
 http://www.mingw.org/
 When installing, be sure to install g++ in addition to the default gcc.   Typlical install path is c:\MinGW, but it shouldn't matter.
 direct download (almost): 
 http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=240780&release_id=529741
 more info: http://www.mingw.org/download.shtml 
 Also download Mingw32-make (this is required for the QT compilation):
 direct download (almost):
 http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=23918&release_id=531888
 Extract to C:\MinGW


2 - Install "MSYS base system" current release "MSYS-1.0.10.exe"

 download: 
 http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=24963
 more info: http://www.mingw.org/
 During the installation leave destination folder as C:\Msys\1.0 
 When instructed by msys (in a DOS window) enter the path where you installed MinGW.

You might find that you get an error in "sync with child / child state waiting for longjump" or "Couldn't reserve space for cygwin's heap" when in the post-instllation (DOS window). This error definitely occurs with Vista 64 bit edition. The solution that I found to solve the problem, is to go to the MSYS Technology Preview download page and select the MSYS-1.0.11-20071204.tar.bz2 file:

 http://downloads.sourceforge.net/mingw/MSYS-1.0.11-20071204.tar.bz2?modtime=1196807934&big_mirror=1
 Then, unpack the files on your existing MSYS directory (default C:\MSys\1.0). It should 
 overwrite these files: 
 bin/msys-1.0.dll 
 bin/mount.exe 
 bin/ps.exe

After doing this you can run C:\msys\1.0\postinstall\pi.bat again and this time there should be no errors.

3 - download and extract MSYS additional component/s: into your MSYS instalation :

 3a:  bash -  bash-3.1-MSYS-1.0.11-1.tar.bz2  
 direct download:
 http://downloads.sourceforge.net/mingw/bash-3.1-MSYS-1.0.11-1.tar.bz2?modtime=1195140582&big_mirror=1
 Extract to C:\MSys\1.0 and overwrite any existing files
 3b:  zlib
 direct download:
 http://downloads.sourceforge.net/mingw/zlib-1.2.3-MSYS-1.0.11.tar.bz2?modtime=1190248364&big_mirror=1
 Extract contents, then copy contents of usr folder (ie folders of bin, include, lib and share) to C:\MSys\1.0
 Not sure what is going on, but I found that when running .configure in taglib it could not find zlib unless I copied it into MinGW -- Simon Kenyon
 3c: 'pr' command
 the coreutils package contains the 'pr' command.
 direct download:
 http://downloads.sourceforge.net/mingw/coreutils-5.97-MSYS-1.0.11-snapshot.tar.bz2?modtime=1188741011&big_mirror=1
 Extract the file, then copy the contents of the coreutils-5.97 subfolder to C:\MSys\1.0

4 - optionally update the GCC version.

Andrei used GCC 4.2.2 from here (and has had success!):

 http://www.tdragon.net/recentgcc/
 It's a drop-in replacement for MinGW gcc, and it comes with pthread library.
 direct downloads:
 http://downloads.sourceforge.net/tdm-gcc/gcc-4.2.2-tdm-1-core-1.7z
 http://downloads.sourceforge.net/tdm-gcc/gcc-4.2.2-tdm-1-g++-1.7z
 (requires 7-zip to extract: see http://www.7-zip.org/download.html)

Note: The notes on the above page indicate that the Technology Preview from the main MinGW page might be better.

Buzz will be trying to build with the default mingw (3.4.5) or if necessary the technology preview of 4.2.1.

 So far, 4.2.1 has NOT been been needed, but he's not finished the build process yet. Here's the links to it anyway.
 4.2.1 preview:
 http://downloads.sourceforge.net/mingw/gcc-core-4.2.1-sjlj-2.tar.gz?modtime=1187065794&big_mirror=1
 After downloading extract to C:\MinGW and overwrite any files there
 http://downloads.sourceforge.net/mingw/gcc-g%2B%2B-4.2.1-sjlj-2.tar.gz?modtime=1187065795&big_mirror=1
 After downloading extract to C:\MinGW and overwrite any files there
 To make GCC 4.2.1 the default version, do the following commands in C:\MinGW\bin:
 copy gcc-sjlj.exe gcc.exe
 copy gccbug-sjlj.exe gccbug.exe
 copy mingw32-gcc-sjlj.exe mingw32-gcc.exe
 copy g++-sjlj.exe g++.exe
 copy mingw32-g++-sjlj.exe mingw-g++.exe
 http://downloads.sourceforge.net/mingw/libgcc_sjlj_1.dll.gz?modtime=1187162717&big_mirror=1
 After downloading extract to ???


5 - install tortoiseSVN for GUI access to subversion.

 http://tortoisesvn.tigris.org/
 direct download:
 http://downloads.sourceforge.net/tortoisesvn/TortoiseSVN-1.4.5.10425-win32-svn-1.4.5.msi?download

6 - get the latest copy of the mythtv source code :

 a - make a folder c:\mythtv\
 b - right-click on the mythtv folder you just created and choose "SVN Checkout..."
 c - enter the string "http://svn.mythtv.org/svn/trunk/" (without the quotes) into the tortoiseSVN window, and click OK. 
 c - wait for very large download to finish (roughly 127MB)

7 - enter the msys environment by running c:\msys\1.0\msys.bat

 Looks like unix doesn't it!.
 HINT: type 'mount' to see how msys lays out it's folders.

8 - mingw-utils

 Download mingw-utils-0.3.tar.gz (almost direct):
 http://downloads.sourceforge.net/mingw/mingw-utils-0.3.tar.gz?modtime=1077321600&big_mirror=1
 Extract it to c:\MinGW

9 - Don't forget to export QT environment variables

   export QTDIR=/--path to qt location--/qt-3.3.x-p8
   export QMAKESPEC=$QTDIR/mkspecs/win32-g++
   export LD_LIBRARY_PATH=$QTDIR/lib:/usr/lib:/mingw/lib
   export PATH=$QTDIR/bin:$PATH

10 - download and compile all the libs for all the libraries listed below in the "libs" section. a lot of work

Hopefully we'll be able to make all these library dependencies quicker, and just supply pre-built versions to download, for those libraries that are stable.?

11 - try to compile mythv and if successful the plugins too!

 cd /c/mythtv
 cd mythtv
 ./configure --prefix=/usr --disable-dbox2 --disable-hdhomerun \
 --disable-dvb --disable-ivtv --disable-iptv --disable-joystick-menu \
 --disable-xvmc-vld --disable-x11 --disable-xvmc --enable-directx \
 --enable-memalign-hack --cpu=k8 --compile-type=debug
 make 
 make install
 cd ..


 cd mythplugins
 ./configure --prefix=/usr --disable-mythgallery --disable-mythmusic --disable-mytharchive --disable-mythbrowser --disable-mythflix --disable-mythgame --disable-mythnews --disable-mythphone --disable-mythzoneminder --disable-mythweb --enable-aac --enable-libvisual --enable-fftw --compile-type=debug --disable-x11 --disable-v4l --disable-audio-oss --disable-audio-alsa --disable-ivtv --enable-directx
 make
 make install
 cd ..

Binary Dependencies / Libs

 MySQL:
 download "Windows Essentials (x86)" from here:
 http://dev.mysql.com/downloads/mysql/5.0.html#win32
 almost direct download:
 http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-essential-5.0.45-win32.msi/from/pick#mirrors
 During installation, click the Custom setup type
 Ensure that C Include Files / Lib Files are installed onto the local drive.
 Copy all files from C:\Program Files\Mysql\Mysql Server 5.0\include to C:\MinGW\include
 Copy libmysql.dll from C:\Program Files\Mysql\Mysql Server 5.0\bin to C:\MinGW\lib
 Copy libmysql.lib from C:\Program Files\Mysql\Mysql Server 5.0\lib\opt to C:\MinGW\lib
 cut-n-pase for msys:
 cp /c/Program\ Files/MySQL/MySQL\ Server\ 5.0/include/* /c/MinGW/include/
 cp /c/Program\ Files/MySQL/MySQL\ Server\ 5.0/bin/libmySQL.dll /c/MinGW/lib
 cp /c/Program\ Files/MySQL/MySQL\ Server\ 5.0/lib/opt/libmysql.lib /c/MinGW/lib
 Ensure you have installed the reimp dependency (step 8)
 Start the Msys environment
 cd /mingw/lib
 reimp -d libmysql.lib
 dlltool -k --input-def libmysql.def --dllname libmysql.dll --output-lib libmysql.a

The steps for rebuilding libmysql.a came from: http://wiki.qtcentre.org/index.php?title=Building_the_QMYSQL_plugin_on_Windows_using_mingw

Now we need to edit mysql.h (locate inside c:\mingw\include) to get around a winsock/socket problem: Comment out (i.e. insert //) in the two lines in front and after "#include <winsock.h> in /mingw/include/mysql.h so it now reads:

//#ifdef __LCC__
#include <winsock.h>				/* For windows */
//#endif
 libpthread (precompiled) (this is not required if you compile from source as per below):
 site: http://sourceware.org/pthreads-win32/
 Save libpthreadGC2.a as libpthread.a into the lib directory (c:\mingw\lib\libpthread.a) 
 direct download: ftp://sources.redhat.com/pub/pthreads-win32/dll-latest/lib/libpthreadGC2.a
 Save pthreadGC2.dll into the MinGW bin directory (c:\mingw\bin) 
 direct download: ftp://sources.redhat.com/pub/pthreads-win32/dll-latest/lib/pthreadGC2.dll
 Download all header files from include/ to the include directory (c:\mingw\include) 
 direct download (almost): ftp://sources.redhat.com/pub/pthreads-win32/dll-latest/include/
 (details came from this link: http://www.gnunet.org/hacking_win32_build.php3  - it has a good summary)

Source Libs

For all the libs below, except when noted otherwise, use tar xvzf xxxx.tar.gz, cd xxxxx, ./configure --prefix=/usr && make && make install to build and install them, there's nothing special that needs to be done.

TIP: For those unfamiliar with libraries, using the shortname (eg 'ogg') normally refers to a download/library called 'libogg.xxxxx.tar.gz', or similar.

 freetype: 
 http://savannah.nongnu.org/projects/freetype
 direct download:
 http://download.savannah.nongnu.org/releases/freetype/freetype-2.3.5.tar.gz
 build it with "./configure --prefix=/mingw" because using "--prefix=/usr" seems to not work (Freetype library is not detected by mythtv configure)
 lame: download version 3.97 from sourceforge
 http://lame.sourceforge.net/index.php
 direct download (almost):
 http://sourceforge.net/project/showfiles.php?group_id=290&package_id=309&release_id=450142
 build it with ./configure --prefix=/usr;make;make install
 mad: version 0.15.1b from sourceforge
 http://www.underbit.com/products/mad/
 direct download (almost):
 http://sourceforge.net/project/showfiles.php?group_id=12349&package_id=86999&release_id=217880
 ./configure --prefix=/usr;make;make install
 taglib: version 1.4 from freshmeat:
 homepage:
 http://freshmeat.net/projects/taglib
 direct download:
 http://developer.kde.org/~wheeler/files/src/taglib-1.4.tar.gz
 ./configure --prefix=/usr;make;make install
 TIP: Buzz found that 'make install' failed until all the Makefiles were tweaked:
   change any of these:
     INSTALL = C:/msys/1.0/bin/install -c -p
     INSTALL = ../C:/msys/1.0/bin/install -c -p
     INSTALL = ../../C:/msys/1.0/bin/install -c -p
   into:
     INSTALL = /bin/install -c -p
 ogg version 1.1.3 and
 vorbis version 1.2.0 from xiph
 http://xiph.org/downloads/
 You must compile and install three components and in the following order:
   libao
   libogg
   libvorbis
 direct downloads:
 http://downloads.xiph.org/releases/ao/libao-0.8.8.tar.gz
 http://downloads.xiph.org/releases/ogg/libogg-1.1.3.tar.gz
 http://downloads.xiph.org/releases/vorbis/libvorbis-1.2.0.tar.gz
 for vorbis, use "./configure --prefix=/usr --disable-shared"
 (or find how to resolve undefined references to libogg, this shouldn't be too hard).
 flac 1.2.1
 http://flac.sourceforge.net/
 direct download (almost):
 http://sourceforge.net/project/showfiles.php?group_id=13478&package_id=12677&release_id=539981
 TIP: flac version 1.2.1 may not compile.
   Buzz found that to add:
    #define SIZE_T_MAX UINT_MAX  
   to the end of the /mingw/include/limits.h file got it build (after a 'make clean').
   ( see this link: see http://forum.zdoom.org/viewtopic.php?f=7&t=15452&p=310197 ) 
 libpthread (from source) - not required if you got the precompiled version above!
 site: site: http://sourceware.org/pthreads-win32/
 direct download: ftp://sourceware.org/pub/pthreads-win32/pthreads-w32-2-8-0-release.tar.gz 
 * extract, and build in msys with the command:  
 tar -zxvpf pthreads-w32-2-8-0-release.tar.gz
 cd pthreads-w32-2-8-0-release
 make clean GC GC-static
 * copy libraries/includes (same files as per above precompiled version) to the right location:
 cp ./libpthreadGC2.a /mingw/lib/libpthread.a
 cp ./pthreadGC2.dll /mingw/bin/
 cp ./pthread.h /mingw/include
 cp ./sched.h /mingw/include/
 cp ./semaphore.h /mingw/include/


 directX header files
 You will need a copy of the Microsoft DirectX SDK for dsound.h, d3dtypes.h and ddraw.h. To get the needed DirectX 
 header files from the Microsoft DirectX SDK:
   * Go to http://msdn.microsoft.com/downloads/
   * Select the DirectX SDK (November 2007)
   * Click on the Download link on the right
   * This is a 427 MB file!
   * Run the downloaded program
   * Untick "When done unzipping open Setup.exe" - there is no need to install the SDK
   * click Unzip to extract it to C:\mssdk\temp
   * Click "OK" and "Close" when the program finishes extracting the files
   * Copy the following files from SDK's include directory (C:\mssdk\temp\Include) ddraw.h dinput.h and dsound.h to 
 the to the mingw include directory (C:\MinGW\Include) 
 There is a d3d9types.h. Should this be renamed to d3dtypes.h? Also the list at the start of the header file section 
 is different to the list at the end! (I merged them to be safe) -- Simon Kenyon

Optional libraries: For "MythGallery":

 tiff 
 http://www.libtiff.org/
 direct download:
 ftp://ftp.remotesensing.org/pub/libtiff/tiff-3.8.2.tar.gz
 exif
 http://libexif.sourceforge.net/
 direct download:
 https://sourceforge.net/project/showfiles.php?group_id=12272&package_id=38136&release_id=515385

for "MythMusic":

 libvisual
 http://sourceforge.net/projects/libvisual/
 direct download:
 http://downloads.sourceforge.net/libvisual/libvisual-0.4.0.tar.gz?modtime=1142891522&big_mirror=0
 SDL
 http://www.libsdl.org/
 direct download: 
 http://www.libsdl.org/release/SDL-1.2.12.tar.gz
 Buzz is currently unable to build SDL because of this error:
 /bin/sh ./libtool --mode=link gcc -o build/libSDL.la build/SDL.lo build/SDL_error.lo build/SDL_fatal.lo 
 build/SDL_audio.lo build/SDL_audiocvt.lo build/SDL_audiodev.lo build/SDL_mixer.lo build/SDL_mixer_MMX.lo 
 build/SDL_mixer_MMX_VC.lo build/SDL_mixer_m68k.lo build/SDL_wave.lo build/SDL_cdrom.lo build/SDL_cpuinfo.lo 
 build/SDL_active.lo build/SDL_events.lo build/SDL_expose.lo build/SDL_keyboard.lo build/SDL_mouse.lo 
 build/SDL_quit.lo build/SDL_resize.lo build/SDL_rwops.lo build/SDL_getenv.lo build/SDL_iconv.lo   
 build/SDL_malloc.lo build/SDL_qsort.lo build/SDL_stdlib.lo build/SDL_string.lo build/SDL_thread.lo 
 build/SDL_timer.lo build/SDL_RLEaccel.lo build/SDL_blit.lo build/SDL_blit_0.lo build/SDL_blit_1.lo 
 build/SDL_blit_A.lo build/SDL_blit_N.lo build/SDL_bmp.lo build/SDL_cursor.lo build/SDL_gamma.lo 
 build/SDL_pixels.lo build/SDL_stretch.lo build/SDL_surface.lo build/SDL_video.lo build/SDL_yuv.lo   
 build/SDL_yuv_mmx.lo build/SDL_yuv_sw.lo build/SDL_joystick.lo build/SDL_nullevents.lo build/SDL_nullmouse.lo 
 build/SDL_nullvideo.lo build/SDL_diskaudio.lo build/SDL_dummyaudio.lo build/SDL_sysevents.lo 
 build/SDL_sysmouse.lo build/SDL_syswm.lo build/SDL_wingl.lo build/SDL_dibevents.lo build/SDL_dibvideo.lo 
 build/SDL_dibaudio.lo build/SDL_mmjoystick.lo build/SDL_syscdrom.lo build/SDL_sysmutex.lo build/SDL_syssem.lo 
 build/SDL_systhread.lo build/SDL_syscond.lo build/SDL_systimer.lo build/SDL_sysloadso.lo build/version.o  -lm 
 -luser32 -lgdi32 -lwinmm -no-undefined -rpath /usr/lib -release 1.2 -version-info 11:1:11
 libtool: link: cannot build libtool library `build/libSDL.la' from non-libtool objects on this host: 
 build/version.o
 make: *** [build/libSDL.la] Error 1


 fftw 
 http://www.fftw.org/
 direct download:
 http://www.fftw.org/fftw-3.1.2.tar.gz
 TIP:(you might want to configure with "./configure --prefix=/usr --with-gcc-arch=k8")
 TIP: there are also MinGW tips here: http://www.fftw.org/install/windows.html

QT

QT deserves its own section on this page, because it wasn't trivial to make QMake work, and because it had a couple of bugs, one of them critical, leading to deadlocks in MythFrontend.

1 - Download QT 3:

 direct download (almost):
 http://downloads.sourceforge.net/qtwin/qt-3.3.x-p8.tar.bz2?modtime=1178810003&big_mirror=0
 
 TIP: extract the .tar.bz2 file somewhere handy.  Buzz extracted to the folder C:\msys\1.0\qt-3.3.x-p8\
 

2 - define where you extracted it to! (IMPORTANT - DO NOT SKIP!)

 set QTDIR=C:\msys\1.0\qt-3.3.x-p8


3 - Apply the qt patch from here: http://svn.mythtv.org/trac/ticket/4270

 download it to the qt-3.3.x-p8 sources folder from step 1
 direct download: http://svn.mythtv.org/trac/raw-attachment/ticket/4270/qt.patch.gz
 (this is easiest to do in a msys window:)
 cp qt.patch.gz $QTDIR
 cd $QTDIR
 gunzip qt.patch.gz
 patch -p1 < qt.patch

NOTE: The patch fixes one critical bug, fixes one issue preventing it from working properly with bash, implements "install" in makefiles, and reduces number of compiler warnings during MythTV compilation. Unfortunately, this breaks QT build scripts, but it still allows to build the qt-mt3.dll properly.

Now build QT using command line tools:

4 - Open a CMD.exe window (start->run->type 'cmd'->OK) - NOT a msys window!

 NOTE: building QT is NOT done in the msys environment, it's done in a DOS(cmd.exe) box!

5 - Make sure you haven't msys or cygwin in your PATH! - optional?

 Some people (ie Buzz) have found this isn't necessary if you rename the sh.exe 
 in step 7 (and then back again in step 11).
 I get errors about not finding cp or rm when I do NOT have c:\msys\bin in my path. -- zack

6 - Setup Qt build environment :

 c:\>cd %QTDIR%                                  # see QT step 2 if you havent set this variable already!
 C:\msys\1.0\qt-3.3.x-p8> set MINGW=c:\MinGW
 C:\msys\1.0\qt-3.3.x-p8> set PATH=%QTDIR%\bin;%MINGW%\bin;%PATH%
 C:\msys\1.0\qt-3.3.x-p8> set QMAKESPEC=win32-g++

NOTE: Background information on what is happening here:

 The configure.bat first creates link_includes.exe and configure.exe which are needed for 
 bootstrap the build process. link_includes.exe copies all relevant Qt headers into the 
 include-directory. configure.exe is the replacement for the ./configure-script unter 
 Unix/Linux.  After that, qmake.exe is built and the compilation gets started.  

7 - QT doesn't like sh.exe:

   To get the QT build to work temporarily rename the sh.exe which MINGW and MSYS use. 
   c:\>rename c:\msys\1.0\bin\sh.exe sh_.exe
   c:\>rename c:\MinGW\bin\sh.exe sh_.exe             # may not exist, but if it does, rename it.

TIP: Once the libaries are compiled you can rename them back.


8 - Next we need to configure and build the source - This should build the whole Qt release:

 C:\msys\1.0\qt-3.3.x-p8>configure.bat -thread -plugin-sql-mysql -opengl -no-sql-sqlite 

TIP: configure knows some of the parameters of the x11 release configure script like -fast or -verbose. For a full list see bin\configure.exe -help.

9 - If the compliation of QT is stopped (Ctrl-C), you can restart compiling with:

 C:\msys\1.0\qt-3.3.x-p8> mingw32-make [target]

TIP: for a list of all available [target]'s see the toplevel Makefile. WARNING: However, a word of warning, this doesn't always seem to resume the entire compilation of the tools area (perhaps I stopped it too early with ctrl-c) -- Richard Dale

10 - Copy libqt-mt3.dll to libqt-mt.dll (since this is what Myth is expecting)

 C:\msys\1.0\qt-3.3.x-p8> cd lib
 C:\msys\1.0\qt-3.3.x-p8\lib>copy libqt-mt3.dll libqt-mt.dll


11 - Rename c:\msys\1.0\bin\sh_.exe back to sh.exe ( ie reverse step 7 )

Problems others have encountered

Problem:

 ./configure: line 245: pr: command not found

Solution:

 The 'pr' command is missing from your mingw install, installing "additional components" into your MSYS install will fix 
 this (see step 3 above for hints).  From memory, I think the additional component is "bash-utils".??

Problem:

  I have compiled all of the dependencies and such but when I go to run the configure script for myth I get:
 "ERROR! You must have FreeType installed to compile MythTV."

Solution:

 Have you installed freetype with "make install"? Do you have  libfreetype-6.dll in your mingw bin directory 
 and freetype2/freetype in your include directory?
 I installed the libraries directly to the mingw installation: "./configure --prefix=/mingw && make && make install" - zack
 I have confirmed the problem named above occurs when you use "--prefix=/usr", and Zack solution fixes it. no idea why though. - Buzz.

Problem:

  QT compile failed it could not find mysql.h

Solution:

 In mysql.h, there are lines that start with something like "MinGW supports unix API" - make sure you comment or remove 
 them or you will be getting segfaults because the functions will be declared as stdcall when they are cdecl 
 (or something close to it) - Andrei

Problem:

 there are some issues with the mysql package in that there is no supplied libmysql.a

Solution:

 You don't need libmysql.a, gcc can link directly against libmysql.dll - Simon Kenyon (Actually, I asked the question; Andre provided the answer)

Problem:

 QT issue: Are you saying that i don't need to do any of this reimp/dlltool nonsense?

Comments/Solution:

 Yes, that's what I'm saying. I had more problems with the import libraries than without them. One of the changes I made 
 to qmake's mkspec is to stop generating them. - Andrei  ( I think Andrei was refering to the QT patch on Ticket #4270 ?? - Buzz)

Problem:

 I'm getting the following error
 g++ -c -mthreads -w -O2 -fexceptions -frtti -DQT_SHARED -DQT_THREAD_SUPPORT -DQT
 _ACCESSIBILITY_SUPPORT -DQT_TABLET_SUPPORT -DQT_NO_DEBUG -DUNICODE -DQT_MAKEDLL
 -DQT_THREAD_SUPPORT -DQT_NO_CUPS -DQT_NO_NIS -DQT_NO_STYLE_MAC -DQT_NO_STYLE_AQU
 A -DQT_NO_STYLE_WINDOWSXP -DQT_NO_STYLE_POCKETPC -DQT_DLL -DQT_MAKEDLL -I"tmp" -
 I"3rdparty/libmng" -I"3rdparty/libjpeg" -I"3rdparty/libpng" -I"3rdparty/zlib" -I
 "C:\msys\1.0\qt/include" -I"tmp/moc/release-shared-mt/" -I"C:/msys/1.0/qt/mkspec
 s/win32-g++" -o tmp/obj/release-shared-mt/qsound_win.o kernel/qsound_win.cpp
 kernel/qsound_win.cpp:194:26: error: qsound_win.moc: No such file or directory
 mingw32-make[2]: *** [tmp/obj/release-shared-mt/qsound_win.o] Error 1
 mingw32-make[2]: Leaving directory `C:/msys/1.0/qt/src'
 mingw32-make[1]: *** [sub-src] Error 2
 mingw32-make[1]: Leaving directory `C:/msys/1.0/qt'
 mingw32-make: *** [init] Error 2
 C:\msys\1.0\qt>
 Anyone know what to do to fix this?
 -- Simon Kenyon

Comments/Solution:

I'm not sure why this happens as I had one install of msys work fine and then same error as you.
In the end I had to cd into /msys/qt-3/src and edit the Makefile and add
-I"c:/msys/qt-3/src/tmp/moc/release-shared-mt" 
on the INCPATH line (I have the qt-3 src at c:/msys).

Problem:

 When compiling mythtv the linker complains about not finding libs.

Solution:

 export LD_LIBRARY_PATH=$QTDIR/lib:/usr/lib:/mingw/lib

Problem:

 Mythtv dies when starting with a NO SQL drivers message.

Solution:

 cd $QTDIR/lib && cp ../plugins/sqldrivers/libqsqlmysql.dll .

Problem:

 QT compilation dies when getting to mysql.h / mysql_com.h include files with errors like:
 ...mysql_com.h:183: error: `SOCKET' does not name a type

Solution:

 Comment out (insert //) in the two lines in front and after "#include <winsock.h> in /mingw/include/mysql.h
 so it now reads:
 //#ifdef __LCC__
 #include <winsock.h>				/* For windows */
 //#endif


Problem:

 Mythtv installation errors on the cp command.

Solution:

 Alter the Makefiles (at least mythtv/themes/Makefile) at COPY_DIR to:
 COPY_DIR        =       cp -rf

Problem:

 I get undefined references when trying to compile QT:
 obj/qsql_mysql.o:qsql_mysql.cpp:(.text+0x45): undefined reference to `mysql_errno@4'
 obj/qsql_mysql.o:qsql_mysql.cpp:(.text+0x58): undefined reference to `mysql_error@4'
 obj/qsql_mysql.o:qsql_mysql.cpp:(.text+0x33a): undefined reference to `mysql_free_result@4'
 obj/qsql_mysql.o:qsql_mysql.cpp:(.text+0x3b9): undefined reference to `mysql_data_seek@12'
 More info:  I already have the libmysql.dll inside c:\mingw\lib - where does libmysql.a 
 come from given the comments above that the reimp stuff is no longer required?  -- Richard

Solution:

 Looks like it can't find the mysql library (libmysql.a).  Follow the steps precisely in the MySQL section above (particularly the reimp section) to create libmysql.a 

Problem:

 Mythtv compilation fails with something like can't find libqt-mt.

Solution:

 you missed the step about copying the dll to a different name:
 cd $QTDIR/lib
 copy libqt-mt3.dll libqt-mt.dll

Problem:

 During QT compilation uic.exe cannot be found, with the following error message:
 mingw32-make[3]: Entering directory `C:/mythfiles/qt-3.3/tools/assistant'
 c:\mythfiles\qt-3.3/bin/uic.exe finddialog.ui -o finddialog.h
 process_begin: CreateProcess(NULL, c:\mythfiles\qt-3.3/bin/uic.exe finddialog.ui -o finddialog.h, ...) failed.
 make (e=2): The system cannot find the file specified.
 mingw32-make[3]: *** [finddialog.h] Error 2

Solution:

 This might have been caused by the original configure.bat being interrupted.  Compile the uic.exe with:
 cd tools\designer\uic
 qmake uic.pro
 mingw32-make
 then resume your original compilation of QT:
 cd ..\..\..
 mingw32-make

Problem:

 During QT compilation, the process is halted due to a Makefile not existing with the following error:
 mingw32-make[4]: Entering directory `C:/mythfiles/qt-3.3/tools/linguist/tutorial'
 mingw32-make[4]: Makefile: No such file or directory
 mingw32-make[4]: *** No rule to make target `Makefile'.  Stop.

Solution:

 Create a dummy Makefile in the folder than doesn't have one with the following commands.
 cd tools\linguist\tutorial
 notepad Makefile.
 Inside notepad add a single line that reads:
   all:
 Save the Makefile
 cd ..\..\..
 mingw32-make

Problem:

 During mythtv make, various warnings about:
 c:/qt/3.3.x-p8/include/qpixmap.h:249: warning: 'void bitBlt(QPaintDevice*, int, int, const    QPaintDevice*, int, int, int, int, Qt::RasterOp, bool)' redeclared without dllimport attribute after being referenced with dllimport linkage
 Anyone know what to do to fix this? Arnon

Solution:

 ??none known??


Problem:

 During debugging, I found one more bug in QT: QSocketNotifier never generates "signals" for listening
 sockets, which effectively prevents anything that listens incoming connections (mythbackend and 
 possibly UPNP code in mythfrontend too) from accepting them. - Andrei (was this you?)

Solution:

 ??none known??

Problem:

 In file included from audiooutput.cpp:13:
 audiooutputdx.h:9:39: dsound.h: No such file or directory
 audiooutputdx.h:34:2: warning: #warning Several methods in AudioOutputDX need to be implemented...
 In file included from audiooutput.cpp:13:
 audiooutputdx.h:60: error: `LPDIRECTSOUND' does not name a type
 audiooutputdx.h:61: error: `LPDIRECTSOUNDBUFFER' does not name a type
 audiooutputdx.h:64: error: `LPDIRECTSOUNDNOTIFY' does not name a type
 audiooutputdx.h:65: error: `DSBPOSITIONNOTIFY' does not name a type
 make[2]: *** [audiooutput.o] Error 1
 make[2]: Leaving directory `/c/mythtv/mythtv/libs/libmyth'
 make[1]: *** [sub-libmyth] Error 2
 make[1]: Leaving directory `/c/mythtv/mythtv/libs'
 make: *** [sub-libs] Error 2

Solution:

 you don't have the "directX header files" - please install these as per the above!

Problem:

 For whatever reason, during the build of qt I had a problem with uic.exe not being able to find libqt-mt3.dll.

Solution:

 Nasty hack. I copied it from %QTDIR%\lib to C:\WINDOWS\system32
 My QT build seems to copy it into %QTDIR\bin --zack