Compiling problem in sndsample.cpp

  • Gert Brinkmann

    Gert Brinkmann - 2005-09-19


    because ultimate stunts really looks great and because I am missing a multiplayer network racing game I wanted to give it a try. So I have downloaded the src+data package
    ultimatestunts-srcdata-0561.tar.gz and tried to compile it.

    ./configure runs ok after installing some dev-packages:
    Some important results:
    Network libraries: "-lresolv -lnsl "
    Sound libraries: "-lopenal "
    Graphics libraries: "-lGLU -lGL  -L/usr/X11R6/lib  -lSM -lICE -lX11 -lXi -lXext -lXmu  -lm"
    SDL libraries: "-L/usr/lib -lSDL -lpthread "
    Prefix dir: "/usr/local"
    usdatadir: "/usr/local/share/ultimatestunts/"

    But compiling stops with the following error:

    if g++ -DHAVE_CONFIG_H -I. -I. -I..  -I../intl -I../shared -I../simulation -I../graphics    -Wall -g -O2  -I/usr/X11R6/include -I/usr/include/SDL -D_REENTRANT -MT sndsample.o -MD -MP -MF ".deps/sndsample.Tpo" \   -c -o sndsample.o `test -f 'sndsample.cpp' || echo './'`sndsample.cpp; \ then mv -f ".deps/sndsample.Tpo" ".deps/sndsample.Po"; \ else rm -f ".deps/sndsample.Tpo"; exit 1; \ fi
    sndsample.cpp: In member function 'virtual bool CSndSample::load(const CString&, const CParamList&)':
    sndsample.cpp:111: error: invalid conversion from 'ALubyte*' to 'const ALchar*'
    sndsample.cpp:111: error:   initializing argument 1 of 'void* alGetProcAddress(const ALchar*)'
    sndsample.cpp:137: error: invalid conversion from 'ALubyte*' to 'const ALchar*'
    sndsample.cpp:137: error:   initializing argument 1 of 'void* alGetProcAddress(const ALchar*)'
    sndsample.cpp:162: error: 'alutLoadWAV' was not declared in this scope
    make[2]: *** [sndsample.o] Error 1
    make[2]: Leaving directory `/home/gert/down/ultimatestunts-srcdata-0561/ultimatestunts'
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory `/home/gert/down/ultimatestunts-srcdata-0561'
    make: *** [all] Error 2

    What might be the problem? Do you need more information?

    • Gert Brinkmann

      Gert Brinkmann - 2005-09-20

      I should mention my system config:

      debian/sid  cpu:k7

      gcc version 4.0.2 20050917 (prerelease) (Debian 4.0.1-8)

    • CJP

      CJP - 2005-10-24

      It's an incompatibility between openAL versions. I'll add a new check in the configure script to check whether you use the correct version. I'll also make a configure commandline option for compiling without sound.

      Ultimate Stunts is currently written for the openAL version that is supplied with SuSE 9.0 (which is incompatible with the current openAL-CVS version). For practical reasons, this cannot be changed until I switch to Ubuntu (which I will do in a couple of months).

      • Nobody/Anonymous

        I am experiencing the same compile error with openal-0.0.8 on a gentoo linux running on my ppc machine. What version of openal is needed for successful compilation? Or is the fix in the configure script coming soon?


        • CJP

          CJP - 2007-01-11

          Will be fixed in version 0.7.0

          Actually, I'm currently developing on an OpenAL 0.0.8 system

        • oc2pus

          oc2pus - 2007-01-29

          try this patch on gentoo:

          --- ultimatestunts/sndsample.cpp
          +++ ultimatestunts/sndsample.cpp
          @@ -96,10 +96,7 @@
               //data (and default values)
               void *wave = NULL;
          -        format = AL_FORMAT_MONO16,
          -        size = 0,
          -        bits = 0,
          -        freq = 44100;
          +        size = 0;

               CString extension = realfile.mid(realfile.length() - 4);
          @@ -108,7 +105,7 @@
                   //the loading proc
                   ALboolean (*alutLoadVorbis)(ALuint, ALvoid *, ALint) =
          -            (ALboolean (*)(ALuint, ALvoid *, ALint))alGetProcAddress((ALubyte *) VORBISFUNC);
          +            (ALboolean (*)(ALuint, ALvoid *, ALint))alGetProcAddress(VORBISFUNC);

                   if(alutLoadVorbis == NULL)
          @@ -134,7 +131,7 @@
                   //the loading proc
                   ALboolean (*alutLoadMP3)(ALuint, ALvoid *, ALint) =
          -            (ALboolean (*)(ALuint, ALvoid *, ALint))alGetProcAddress((ALubyte *) MP3FUNC);
          +            (ALboolean (*)(ALuint, ALvoid *, ALint))alGetProcAddress(MP3FUNC);

                   if(alutLoadMP3 == NULL)
          @@ -158,9 +155,9 @@
               else //default: load as wave file
          -        alGenBuffers(1, &m_Buffer);
          -        alutLoadWAV(realfile.c_str(), &wave, &format, &size, &bits, &freq);
          -        alBufferData(m_Buffer, format, wave, size, freq);
          +        m_Buffer = alutCreateBufferFromFile(realfile.c_str());
          +        if(m_Buffer == AL_NONE)
          +            printf("%s\n", alutGetErrorString(alutGetError()));



Log in to post a comment.