From 53ae52c7c98b88e266aaa647ae401809a74035d0 Mon Sep 17 00:00:00 2001 From: nkorslund Date: Fri, 1 Aug 2008 21:54:47 +0000 Subject: [PATCH] Windows build still not finished git-svn-id: https://openmw.svn.sourceforge.net/svnroot/openmw/trunk@37 ea6a568a-9f4f-0410-981a-c910a81bb256 --- COMPILE-win32.txt | 20 ++++++++++++++------ build_openmw.bat | 13 ++++++++----- sound/al.d | 2 +- sound/alc.d | 2 +- sound/cpp_avcodec.cpp | 5 +++++ 5 files changed, 29 insertions(+), 13 deletions(-) diff --git a/COMPILE-win32.txt b/COMPILE-win32.txt index 7dabda491..9f0b285a8 100644 --- a/COMPILE-win32.txt +++ b/COMPILE-win32.txt @@ -26,8 +26,7 @@ Dependencies needed to build OpenMW: OGRE 1.4.9 (3d engine) OpenAL (3d sound system) -libavcodec, - libavformat (For MP3 playback) +FFmpeg (For MP3 playback) Mingw (C++ compiler) gdc 4.1.3 (mingw) (D compiler) @@ -36,15 +35,18 @@ versions might work. OGRE, OpenAL and OIS are complex libraries with their own set of dependencies. I recommend downloading prebuild SDKs instead of building them from source. -libavcodec and libavformat are part of the FFmpeg package, which is -part of the 'mplayer' project. Note that some of the codecs might be -patented in your country. +FFmpeg package contains the necessary libraries libavcodec and +libavformat. You will most likely have to build it from source. This +can be done either with Mingw32/Msys or with Cygwin. See below for +instructions. Note that some of the codecs included with FFmpeg might +be patented in your country. You can find the libraries here: OGRE: http://ogre3d.org (See "Getting Ogre" in README-win32.txt for details) OIS: Comes with the Ogre SDK OpenAL: http://openal.org/ +FFmpeg: http://ffmpeg.mplayerhq.hu/ Mingw http://sourceforge.net/projects/mingw/ gdc http://sourceforge.net/projects/gdcwin/ @@ -65,11 +67,17 @@ Open a command line. Set up your PATH to include Mingw and gdc (eg. "set PATH=%PATH%;c:\mingw\bin"). Make sure the commands g++ and gdc work (should output "no input files".) -The build script expects to find the Ogre and Audiere SDKs in the +The build script expects to find the Ogre and FFmpeg SDKs in the parent directory. An example directory structure is: c:\openmw\Ogre - Ogre SDK c:\openmw\openmw - OpenMW source +c:\openmw\ffmpeg - FFmpeg + +You must compile FFmpeg from source, since at the time of writing +there are no prebuilt SDKs available. The source must be built with +Mingw as well (not Cygwin!) The following configure flags should work: +./configure --enable-shared --disable--ffserver --disable-ffplay Building diff --git a/build_openmw.bat b/build_openmw.bat index b8fddd477..6e06f9df2 100755 --- a/build_openmw.bat +++ b/build_openmw.bat @@ -2,18 +2,21 @@ rem See COMPILE-win32.txt for instructions. -rem This file assumes it can find Ogre in ..\ogro -rem TODO: Not updated to OpenAL +rem This file assumes it can find Ogre in ..\ogre and that ffmpeg +rem has been downloaded and compiled in ..\ffmpeg echo Compiling C++ files -g++ -c sound\cpp_audiere.cpp -I..\audiere\include +g++ -c sound\cpp_avcodec.cpp -I..\ffmpeg g++ -c ogre\cpp_ogre.cpp -I..\ogre\include copy ..\ogre\bin\debug\ogremain_d.dll . copy ..\ogre\bin\debug\ois_d.dll . copy ..\ogre\bin\debug\cg.dll . -copy ..\audiere\bin\audiere.dll . +copy ..\ffmpeg\libavcodec\cygavcodec-51.dll cygavcodec.dll +copy ..\ffmpeg\libavformat\cygavformat-52.dll cygavformat.dll +copy ..\ffmpeg\libavdevice\cygavdevice-52.dll cygavdevice.dll +copy ..\ffmpeg\libavutil\cygavutil-49.dll cygavutil.dll copy \windows\system32\d3dx9_30.dll d3dx9d_30.dll echo Compiling main program (openmw.exe) -gdc -Wall -g openmw.d bsa\*.d core\*.d esm\*.d input\*.d nif\*.d ogre\*.d scene\*.d sound\*.d util\*.d cpp_ogre.o monster\util\*.d ogremain_d.dll OIS_d.dll -lstdc++ -o openmw.exe +gdc -Wall -g openmw.d bsa\*.d core\*.d esm\*.d input\*.d nif\*.d ogre\*.d scene\*.d sound\*.d util\*.d cpp_ogre.o cpp_avcodec.o monster\util\*.d cygavcodec.dll cygavformat.dll cygavdevice.dll cygavutil.dll openal32.dll ogremain_d.dll OIS_d.dll -lstdc++ -o openmw.exe diff --git a/sound/al.d b/sound/al.d index 459b563cd..91da3f6cc 100644 --- a/sound/al.d +++ b/sound/al.d @@ -1,6 +1,6 @@ module sound.al; -extern(System): +extern(C): //Defines const int AL_NONE = 0; diff --git a/sound/alc.d b/sound/alc.d index 7a2a51dce..06d3b3d01 100644 --- a/sound/alc.d +++ b/sound/alc.d @@ -1,6 +1,6 @@ module sound.alc; -extern(System): +extern(C): //Definitions const int ALC_FALSE = 0; diff --git a/sound/cpp_avcodec.cpp b/sound/cpp_avcodec.cpp index 4973a4359..cf6281572 100644 --- a/sound/cpp_avcodec.cpp +++ b/sound/cpp_avcodec.cpp @@ -24,8 +24,13 @@ #include extern "C" { // the headers don't do this.. +#ifdef WIN32 +#include +#include +#else #include #include +#endif } #include