MacOS X Leopard 10.5.8 - Compilation error with OpenAL

Added by Jeru over 4 years ago

I try to compile the most updated version of NeL-Ryzom Core to test it on my old Mac, but during this operation i got this error :

[ 48%] Building CXX object nel/src/sound/driver/openal/CMakeFiles/nel_drv_openal.dir/buffer_al.cpp.o
/Users/yann/ryzom/code/nel/src/sound/driver/openal/buffer_al.cpp: In member function ‘virtual bool NLSOUND::CBufferAL::fill(const uint8*, uint)’:
/Users/yann/ryzom/code/nel/src/sound/driver/openal/buffer_al.cpp:161: error: invalid conversion from ‘const void*’ to ‘ALvoid*’
/Users/yann/ryzom/code/nel/src/sound/driver/openal/buffer_al.cpp:161: error: initializing argument 3 of ‘ALvoid alBufferData(ALuint, ALenum, ALvoid*, ALsizei, ALsizei)’
make2: * [nel/src/sound/driver/openal/CMakeFiles/nel_drv_openal.dir/buffer_al.cpp.o] Error 1
make1:
[nel/src/sound/driver/openal/CMakeFiles/nel_drv_openal.dir/all] Error 2
make: *
* [all] Error 2

Is this a bug, or do i have some libraries to update ?
Thanks


Replies (14)

RE: MacOS X Leopard 10.5.8 - Compilation error with OpenAL - Added by kervala over 4 years ago

It should compile because I have the same version as you :)

But I could check to be sure.

RE: MacOS X Leopard 10.5.8 - Compilation error with OpenAL - Added by Jeru over 4 years ago

For information :
xCode 3.1.4
Your lua library
MacPorts 1.9.2
X11 2.6

RE: MacOS X Leopard 10.5.8 - Compilation error with OpenAL - Added by rti over 4 years ago

This is really interesting... I think the compiler complains about going from const to non-const.

But if I check my al.h (As installed by 10.6 in /System/Library/Framesworks/OpenAL.framework) it defines in line 595:

AL_API void AL_APIENTRY alBufferData( ALuint bid, ALenum format, const ALvoid* data, ALsizei size, ALsizei freq );

The al.h provided by the ryzom (windows) external package defines in line 602:

AL_API void AL_APIENTRY alBufferData( ALuint bid, ALenum format, const ALvoid* data, ALsizei size, ALsizei freq );

Both headers define parameter 3 as const, so the code in buffer_al.cpp is ok for that.
Could you check the al.h you are using? Does it define parameter 3 of alBufferData as non-const? And if... where did you get that header from? :)

RE: MacOS X Leopard 10.5.8 - Compilation error with OpenAL - Added by Jeru over 4 years ago

The declaration of this fonction is with this form on my mac :

ALAPI ALvoid ALAPIENTRY alBufferData( ALuint buffer,
ALenum format,
ALvoid* data,
ALsizei size,
ALsizei freq );

but in the read me of the OpenAl files, i have this information :
February 13th, 2004 - Apple Computer Inc.
updated: March 15th, 2004 - Apple Computer Inc.

it seems outdated, is there a way to update it ? I tried to download 1.1 version but no change to my files ???
An Idee ?

RE: MacOS X Leopard 10.5.8 - Compilation error with OpenAL - Added by molator over 4 years ago

You will find the lastest version here:
http://connect.creativelabs.com/openal/Downloads/Forms/AllItems.aspx

You can try the macosx one or the source and build it.

RE: MacOS X Leopard 10.5.8 - Compilation error with OpenAL - Added by rti over 4 years ago

Not sure how kervala updated his version of OpenAL on 10.5, mine (on 10.6) is up to date.
But there is an OpenAL (1.3.0) available using macports, so you could try

sudo port install openal

I am not sure if the FindOpenAL mechanism of CMake would prefer the one in /opt/local ... but it's worth a try.

You can check which OpenAL installation is used using (in your cmake build directory):

cat CMakeCache.txt| grep OPENAL_LIBRARY

RE: MacOS X Leopard 10.5.8 - Compilation error with OpenAL - Added by Jeru over 4 years ago

I'll try and check this and come back soon :) Thx

RE: MacOS X Leopard 10.5.8 - Compilation error with OpenAL - Added by Jeru over 4 years ago

You were Right, wrong path in CMakeCache.txt. I've changed it manually and compilation continues... :)

Thx all

RE: MacOS X Leopard 10.5.8 - Compilation error with OpenAL - Added by rti over 4 years ago

Nice!

Could you provide some details please?

  • Which versions do you have installed?
  • Where?
  • Which one was referenced in the cache?
  • And what did you change it to?

Just in case someone else has the same problem... Thanks!

RE: MacOS X Leopard 10.5.8 - Compilation error with OpenAL - Added by Jeru over 4 years ago

To solve the OpenAL NEL sound driver building :

I get the last OpenAL version by :

sudo port install openal

and I've changed all path used as references to OpenAl in CMakeCache.txt (in CMake build folder) so that :
/Library/Frameworks/OpenAL.framework/Headers become /opt/local/Library/Frameworks/OpenAL.framework/Headers and
/Library/Frameworks/OpenAL.framework become /opt/local/Library/Frameworks/OpenAL.framework

RE: MacOS X Leopard 10.5.8 - Compilation error with OpenAL - Added by kervala over 4 years ago

Strange, I'm using system OpenAL and that worked for me :(

RE: MacOS X Leopard 10.5.8 - Compilation error with OpenAL - Added by Jeru over 4 years ago

Strange, Yes.

How did you install the OpenAL library in the OS System Library Folder and not in the opt folder ?
Do you have changed the symlink in the System Folder to go to Opt folder path ?

RE: MacOS X Leopard 10.5.8 - Compilation error with OpenAL - Added by Jeru over 4 years ago

rti : In the src repository there's no FindOpenAL mechanism for CMake

RE: MacOS X Leopard 10.5.8 - Compilation error with OpenAL - Added by rti over 4 years ago

FindOpenAL is part of CMake. So no custom find script is necessary.
For me it is located in /opt/local/share/cmake-2.8/Modules/FindOpenAL.cmake

Some comment from the script:

# For OS X, remember that OpenAL was added by Apple in 10.4 (Tiger). 
# To support the framework, I originally wrote special framework detection 
# code in this module which I have now removed with CMake's introduction
# of native support for frameworks.
# In addition, OpenAL is open source, and it is possible to compile on Panther. 
# Furthermore, due to bugs in the initial OpenAL release, and the 
# transition to OpenAL 1.1, it is common to need to override the built-in
# framework. 
# Per my request, CMake should search for frameworks first in
# the following order:
# ~/Library/Frameworks/OpenAL.framework/Headers
# /Library/Frameworks/OpenAL.framework/Headers
# /System/Library/Frameworks/OpenAL.framework/Headers

(1-14/14)