Error while building - checkALError

Support for running, installing or compiling OpenMW
Locked
User avatar
lgromanowski
Site Admin
Posts: 1193
Joined: 05 Aug 2011, 22:21
Location: Wroclaw, Poland
Contact:

Error while building - checkALError

Post by lgromanowski »

darketalon wrote: Hello.

I'm trying to build OpenMW, but I've got this error:

Code: Select all

 [ 52%] Building CXX object apps/openmw/CMakeFiles/openmw.dir/__/__/libs/mangle/sound/outputs/openal_out.cpp.o
Linking CXX executable ../../openmw
CMakeFiles/openmw.dir/__/__/libs/mangle/sound/outputs/openal_out.cpp.o: In function `checkALError(char const*)':
openal_out.cpp:(.text+0xc2): undefined reference to `alGetError'
openal_out.cpp:(.text+0x109): undefined reference to `alGetString'
openal_out.cpp:(.text+0x149): undefined reference to `alGetString' 
Here is original code from openal_out.cpp:

Code: Select all

 /*
  Check for AL error. Since we're always calling this with string
  literals, and it only makes sense to optimize for the non-error
  case, the parameter is const char* rather than std::string.

  This way we don't force the compiler to create a string object each
  time we're called (since the string is never used unless there's an
  error), although a good compiler might have optimized that away in
  any case.
 */
static void checkALError(const char *where)
{
  ALenum err = alGetError();
  if(err != AL_NO_ERROR)
    {
      std::string msg = where;

      const ALchar* errmsg = alGetString(err);
      if(errmsg)
        fail("\"" + std::string(alGetString(err)) + "\" while " + msg);
      else
        fail("non-specified error while " + msg + " (did you forget to initialize OpenAL?)");
    }
} 
Please, help me: what's wrong?
Zini wrote: Doesn't ring a bell. Anyway, not enough information to help you. I assume you are on Linux? Did you get the code via git? Did the CMake part of the build process produce any warnings?
I don't know the relevant part of OpenMW well enough (Nico did all the work on it), but it looks like an OpenAL problem. Do you have all the required packages installed?
darketalon wrote: Well, thanks. I'm using Ubuntu 10.04, code was get from git. I have many errors during compilation, because I really didn't have all required packages. I spent much time in searchings, and now I assume, that I have them all. So, only for this error I don't find any solution.
Hircine wrote: run

Code: Select all

sudo apt-get install libopenal-dev
in your terminal.

that will install the OpenAL development files needed to compile openmw.
you still may need more packages yet.

hth

Peter.
darketalon wrote: Hmm... Already have this library installed. But error still occur. Thanks anyway.

UPD: Sounds funny, but I fix it. Just remove all "build" folder and run cmake again. Now, when I type "make" there are no errors. Thanks you all.
Locked