HOWTO: Compile OgreAL on Windows + MinGW

kowi

29-03-2007 17:56:56

Hello,

after spending hours on compiling OgreAL on Windows, I wrote this tutorial.

I suppose, you can compile Ogre yourself! Make sure you've set your OGRE_SDK AND OGRE_HOME environment variables! You also need a valid installation of

Code::Blocks and TortoiseSVN!

Get the MinGW Toolbox from

http://prdownloads.sourceforge.net/ogre ... e?download and install

it.

Install MSYS-1.0.10.exe or newer from http://www.mingw.org/download.shtml (Here's

a direct link: http://prdownloads.sf.net/mingw/MSYS-1. ... e?download and install it.

create these two directories:

- c:\ogre
- c:\ogre\OgreAL

Go into the c:\ogre\OgreAL directory using your Explorer. Right click and download

OgreAL
from SVN using TortoiseSVN and this URL:

https://svn.sourceforge.net/svnroot/ogr ... eAL-Eihort

Download libogg and libvorbis from http://xiph.org/downloads/ and unpack

them in the directory we created before: c:\ogre. Rename the two folders to "ogg" and

"vorbis"

You then need to go to OpenAL Download Page and download the OpenAL SDK installer

and the freealut Binary package. Run the OpenAL SDK installer and unzip the

freealut package. You can put them where ever you like on your system since we'll

reference them later with system variables.

The next step is to create two environment variables.

1. OPENAL_SDK - This should point to where ever you chose to install the

SDK.
2. ALUT_BIN - This should point to where ever you unzipped the freealut

package.

You should now see this directory structure:


- c:\ogre
- c:\ogre\OgreAL
- c:\ogre\vorbis
- c:\ogre\ogg


Open up the MSYS console and execute these commands:


cd /c/ogre/ogg

./configure --prefix=/c/ogre/install

make

make install

cd ../vorbis

./configure --disable-oggtest \
--with-ogg=/c/ogre/install/ \
--enable-shared=no \
--prefix=/c/ogre/install

make

make install


You now have compiled and installed ogg and vorbis!

Run the oalinst.exe from the "redist" folder of your OpenAL SDK installation.

Go to the directory c:\ogre\OgreAL and double click on the OgreAL.workspace file.


!!! NOTE: WE WILL ONLY BUILD THE OGREAL PROJECT AND NOT THE DEMOS !!!
!!! WE WILL ONLY BUILD IN DEBUG MODE, YOU CAN FIGURE OUT THE REST YOURSELF !!!


Right click on the OgreAL project and select "Build options".
Left click on "Debug" in the left tree.
Select "GNU GCC Compiler" from the "Selected Compiler" Drop down box.
Click on the "Other options" tab below and remove the three lines.
Go to the "Linker settings" from the drop down box above.
Now remove all the libraries!
Use these instead (I think, you can figure out how to adjust the paths to your system):


..\..\ogrenewCB\lib\OgreMain_d.dll
C:\WINDOWS\system32\OpenAL32.dll
C:\ogre\freealut-1.1.0-bin\lib\alut.dll
C:\ogre\install\lib\libvorbis.dll.a
C:\ogre\install\lib\libvorbisfile.a
C:\ogre\install\lib\libogg.a



I hope this isn't needed in future releases of OgreAL!!!

Comments are welcome!

Konrad

CaseyB

30-03-2007 16:10:59

This is AWESOME!! Thank you so much for working through this! I am going to sticky this post and see if I can work through it on my own! Then, once we get the new Moo Productions site up I'll add these instructions with the others! Great work!

kowi

30-03-2007 17:17:43

This is AWESOME!! Thank you so much for working through this! I am going to sticky this post and see if I can work through it on my own! Then, once we get the new Moo Productions site up I'll add these instructions with the others! Great work!

Thank you very much!

gugus

30-10-2007 16:18:08

hello guys.I am trying to compile with Mingw but I still get this error
..\src\OgreALSound.cpp:338: error: definition of static data member 'OgreAL::SoundFactory::FACTORY_TYPE_NAME' of dllimport'd class
I searched a little on the forum but i did not find any intresting answere....

CaseyB

30-10-2007 16:46:26

I am out of town for a couple of days, but I'll look into this when I get back home.

P.S.
Do you have any issues with Ogre? It does the same thing.

gugus

31-10-2007 07:51:45

Thank for replying.
I did not compile Ogre so i dont know.

mumox

26-02-2008 13:40:09

followed ur instruction, im building the new svn getting this error

/include/OgreALSound.h:318: error: `virtual bool OgreAL::Sound::updateSound()' is protected
C:\OgreAL\src\OgreALSoundManager.cpp:287: error: within this context


cant figure out whats the problem. anybody can help?

CaseyB

26-02-2008 16:50:23

That is because gcc doesn't seem to understand friend classes. I'll fix this and recommit.

reptor

26-02-2008 22:01:50

That is because gcc doesn't seem to understand friend classes. I'll fix this and recommit.

nxogre uses friend classes and it compiles on gcc...

well if you try to compile the 0.9-38 version of nxogre on linux, you have to do some fixes, but it compiles then. You can read about the problems we had with nxogre from the nxogre forum board. Maybe there was something which helps you to see a problem in OgreAL.

RHK

22-07-2008 04:54:24

I'm a noob to Ogre, CodeBlocks, MinGW, and basically everything referenced in this thread. After following the instructions above, I'm still having trouble getting OgreAL to run.

I get the error referenced above in OgreALSound.h; updateSound() is protected. If I comment out the 'protected:' line it seems to compile.

When I build and run the program, I get the error:
You Must select a host application to "run" a library...


Help would be greatly appreciated! Thanks!

IceBerk

04-08-2008 08:50:52


You Must select a host application to "run" a library...

As explained above:

!!! NOTE: WE WILL ONLY BUILD THE OGREAL PROJECT AND NOT THE DEMOS !!!

you build library, not demo application. So you can't run it, you need to compile demo application first :)

hadesNemesis

10-02-2012 23:38:56

Hello i'm using microsoft visual studio 2008 to compile OgreAL, i have this error when compiling

FATAL ERROR LNK1104:cannot open file 'vorbis_static_d.lib'
i could neither find the library in my documents
but i have found only these libraries:
libvorbis\Win32\Debug\libvorbis.lib
libvorbis\Win32\Debug\libvorbis_static.lib
libvorbisfile\Win32\Debug\libvorbisfile.lib

how can i get the file 'vorbis_static_d.lib' please help me

ekow

15-02-2012 10:40:46

Hello i'm using microsoft visual studio 2008 to compile OgreAL, i have this error when compiling

FATAL ERROR LNK1104:cannot open file 'vorbis_static_d.lib'
i could neither find the library in my documents
but i have found only these libraries:
libvorbis\Win32\Debug\libvorbis.lib
libvorbis\Win32\Debug\libvorbis_static.lib
libvorbisfile\Win32\Debug\libvorbisfile.lib

how can i get the file 'vorbis_static_d.lib' please help me

just change the linker depedency into libvorbis_static.lib :P

fyi, this is my debug linker depedencies for OgreAL:
OgreMain_d.lib
OpenAL32.lib
libvorbis_static.lib
libvorbisfile_static.lib
libogg_static.lib

hadesNemesis

22-02-2012 22:03:30

thanks now everything works fine :D