Compiling error on Windows with MinGW

Peaz

18-03-2008 12:05:53

Hey guys,

I've been trying to compile OgreAL on Windows by following the tutorial provided in the forums. I've followed every step as described and everything works as far as I can tell but I get issues with the last step opening the OgreAL.workspace with CodeBlocks and trying to compile the OgreAL project.

I get the following error message when compiling:


-------------- Build: Debug in OgreAL ---------------

Linking dynamic library: ..\lib\Debug\OgreAL_d.dll

..\lib\Debug\src\OgreAlOggSound.o In function 'ZN6OgreAL8OggSound....'
C:\OgreSDK\OgreAL\src\OgreALOggSound.cpp undefined reference to 'OgreAL::check(bool, int, std::string const&, std::string const&)


And I get several more undefined reference to OgreAL::check error messages afterwards. I was just wondering if anyone knows what might be causing this problem?

As far as I can tell I've included all the libraries needed as I've followed the tutorial, and I have kept my previous Compiler And Debugger settings from when I built Ogre so I'm assuming those settings are ok. If anyone has any advice or insight as to what might be going wrong I'd really appreciate it,

thanks in advance,

Peaz

CaseyB

18-03-2008 15:52:58

For some reason there are issues with building OgreAL under MinGW. I am not sure why, it builds fine under Windows and Linux, so I am really at a loss for why MinGW would be a problem. I don't have a MinGW set up so I can't really give any good suggestions. There was a guy who got it to build before and posted instructions, are those the instructions that you were following?

Peaz

18-03-2008 16:41:38

Yeah I was following the instructions in the topic - Sticky : HOWTO: Compile OgreAL on Windows + MinGW

I guess I'll have to find another way to get it working, there seems to be more support for Visual Studio and I'm pretty sure I could get hold of a copy of that so perhaps it'd be worth trying to use that instead.

I'm assuming theres a VS project file to build OpenAL? I'm afraid I'm a bit of a n00b with this kind of thing. Thanks for the response though, all help is very appreciated :)

Peaz

CaseyB

18-03-2008 22:24:33

Yeah, there are VS project files for VS 8(2005) and VS 9(2008). You can get "Express" versions of Visual Studio from Microsoft's website for free!

Peaz

23-03-2008 15:05:53

Cheers for that, I wasn't aware there were express versions so I decided to give them a go. I've managed to build ogg and vorbis using VC9 but when I try and build OgreAL I get a complaint about not being able to find the environment variable $(BOOST_ROOT)

As far as I'm aware Boost is just a way of optimising using threads isn't it? (my lack of knowledge is beginning to show) So I'm pretty sure I could get rid of the variable in the build options but would that effect OgreAL when I build it?

Thanks in advance,

Peaz

reptor

23-03-2008 18:50:47

Solution/Project files are broken as far as I know, if you use VS9 (2008 Express is what I used).

I'm sure that when I tried to use the VS9 solution, it didn't work for the demos at all, and the OgreAL project settings also were broken.

And the solution file for the older version, which VS9 upgraded on load, also needed fixing before it would work.

Remove unnecessary paths from project options. The BOOST thing at least. Also there was two paths for Ogre3D, depending if you use binary or source release of Ogre3D, so remove the other path which you are not using. Can't remember what else there was... I would have torn my hair out if I could (my hair is currently too short for that) so I'm not exactly eager to look at the files again, as I have the projects built.

Peaz

24-03-2008 03:48:06

Ok thanks I figured I could get rid of it. Yeah I needed to tweak a few things as well, things like changing settings from OgreMain_d.lib to OgreMain_d.dll in order to get it to start compiling but I'm sure I can work my way around it :) thanks for all the help, I'll let you know if I get anywhere with it.

Peaz

reptor

24-03-2008 11:34:42

Ok thanks I figured I could get rid of it. Yeah I needed to tweak a few things as well, things like changing settings from OgreMain_d.lib to OgreMain_d.dll in order to get it to start compiling but I'm sure I can work my way around it :) thanks for all the help, I'll let you know if I get anywhere with it.

Peaz


Sounds weird - I didn't have to do that. Maybe someone else can explain why that could be necessary, I'm not an expert on this, I only recently started using Windows too as a development platform.

Peaz

24-03-2008 14:40:09

Perhaps the problem is to do with the fact I built Ogre through codeblocks originally and then tried building OgreAL through VC9. I've just tried building Ogre again from source through VC9 and it seems to have created an OgreMain_d.lib file rather than a .dll

If I had more time I'd love to try and get it working with MinGW again, perhaps when I've finished my uni project and have more time on my hands :) I'll let you know how the building goes.

Peaz

Peaz

25-03-2008 17:01:19

OK, I followed the instructions to build OgreAL for VC9 and it worked partly. I was able to build the OgreALVC9 project without fail but I couldn't get any of the demos to work properly. I first noticed the projects didn't have any include directories so I had to include them myself:

$(OGRE_SRC)/OgreMain/include
$(OGRE_SRC)/Dependencies/include (Needed as I built from source)
$(OPENAL_SDK)/include
C:/Development/OgreAL/include
C:/Development/ogg/include
C:/Development/vorbis/include

After including these I was able to get rid of typical unable to find header messages such as Cannot find OgreCamera.h etc. But then I had the error:

c:\development\ogreal\demos\basic_demo\main.cpp(19) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char *' to 'LPCWSTR'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast

I tracked this down to a try catch function found in every Demo's main.cpp file and so commented it out (as I had no idea how to fix it and was just trying my best to get the demos working) which meant I could compile each demo. But after fixing that I started getting linker errors which I had no idea how to fix so now I'm a bit stumped. I've tried adding directories such as $(OGRE_SRC)/lib to the Additional Library Directories of each demo but that hasn't seemed to fix it. Has anyone else had this problem?

Peaz

Peaz

25-03-2008 17:02:57

Sorry forgot to add as well that I changed the Plugins.cfg file as mentioned at the end of the install instructions but that didn't fix it.

Peaz

CaseyB

26-03-2008 00:13:34

The MessageBoxW issue is because of using the Unicode Character set instead of the Multi-Byte Character set, at least that's what causes it in Visual Studio. Glad you got OgreAL building though!

reptor

26-03-2008 18:27:38

OK, I followed the instructions to build OgreAL for VC9 and it worked partly. I was able to build the OgreALVC9 project without fail but I couldn't get any of the demos to work properly. I first noticed the projects didn't have any include directories so I had to include them myself:

$(OGRE_SRC)/OgreMain/include
$(OGRE_SRC)/Dependencies/include (Needed as I built from source)
$(OPENAL_SDK)/include
C:/Development/OgreAL/include
C:/Development/ogg/include
C:/Development/vorbis/include

After including these I was able to get rid of typical unable to find header messages such as Cannot find OgreCamera.h etc. But then I had the error:

c:\development\ogreal\demos\basic_demo\main.cpp(19) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char *' to 'LPCWSTR'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast

I tracked this down to a try catch function found in every Demo's main.cpp file and so commented it out (as I had no idea how to fix it and was just trying my best to get the demos working) which meant I could compile each demo. But after fixing that I started getting linker errors which I had no idea how to fix so now I'm a bit stumped. I've tried adding directories such as $(OGRE_SRC)/lib to the Additional Library Directories of each demo but that hasn't seemed to fix it. Has anyone else had this problem?

Peaz


Yeah that's why I said that the solution for VS 2008 is broken... then I tried to use the older solution and VS 2008 updated it. But that still required to fix some of the path problems. The solution file for the older VS has a lot more settings in place. The VS9 solution just looks like it was never working.

As I said, the solution(project) files are broken at least for VS2008. It would be better if the whole broken VS9 solution file was not included at all with OgreAL, because I wasted a lot of time with it and others are apparently doing the same.

Of course even better would be if it was working. And I would submit a patch for it if I had the nerves to do it all over again - currently I don't have those kinds of nerves... and I have the binaries :)

Tharbas

10-04-2008 15:19:56

Hey guys,

I've been trying to compile OgreAL on Windows by following the tutorial provided in the forums. I've followed every step as described and everything works as far as I can tell but I get issues with the last step opening the OgreAL.workspace with CodeBlocks and trying to compile the OgreAL project.

I get the following error message when compiling:


-------------- Build: Debug in OgreAL ---------------

Linking dynamic library: ..\lib\Debug\OgreAL_d.dll

..\lib\Debug\src\OgreAlOggSound.o In function 'ZN6OgreAL8OggSound....'
C:\OgreSDK\OgreAL\src\OgreALOggSound.cpp undefined reference to 'OgreAL::check(bool, int, std::string const&, std::string const&)


And I get several more undefined reference to OgreAL::check error messages afterwards. I was just wondering if anyone knows what might be causing this problem?

As far as I can tell I've included all the libraries needed as I've followed the tutorial, and I have kept my previous Compiler And Debugger settings from when I built Ogre so I'm assuming those settings are ok. If anyone has any advice or insight as to what might be going wrong I'd really appreciate it,

thanks in advance,

Peaz


I had the same problem with code::blocks and minGW.
You have to add "src\OgreALException.cpp" and "include\OgreALException.h" to the project and it will compile without an error :)