Bonjour,
j'essaye, en suivant les instructions se trouvant ici :
https://github.com/SFML/SFML/wiki/Tutorial:-Building-SFML-for-Android, d'installer SFML pour le NDK android, sur Mac OS X 10.10.
Tout se passe bien jusqu'au
cmake -DANDROID_ABI=armeabi-v7a -DCMAKE_TOOLCHAIN_FILE=../../cmake/toolchains/android.toolchain.cmake ../..
qui me retourne :
-- Found OpenAL: /System/Library/Frameworks/OpenAL.framework
-- Configuring done
WARNING: Target "sfml-audio" requests linking to directory "/System/Library/Frameworks/OpenAL.framework". Targets may link only to libraries. CMake is dropping the item.
-- Generating done
-- Build files have been written to: /Users/gamma/sfml/SFML/build/armeabi-v7a
Si je continue et lance le make, celui-ci plante lors du linkage de sfml-audio, qui justement requiert OpenAL:
[ 19%] Built target sfml-system
[ 20%] Built target sfml-activity
[ 22%] Built target sfml-main
[ 42%] Built target sfml-window
[ 52%] Built target sfml-network
[ 80%] Built target sfml-graphics
[ 81%] Linking CXX shared library ../../../lib/libsfml-audio.so
CMakeFiles/sfml-audio.dir/AudioDevice.cpp.o:AudioDevice.cpp:function sf::priv::AudioDevice::~AudioDevice(): error: undefined reference to 'alcMakeContextCurrent'
CMakeFiles/sfml-audio.dir/AudioDevice.cpp.o:AudioDevice.cpp:function sf::priv::AudioDevice::~AudioDevice(): error: undefined reference to 'alcDestroyContext'
CMakeFiles/sfml-audio.dir/AudioDevice.cpp.o:AudioDevice.cpp:function sf::priv::AudioDevice::~AudioDevice(): error: undefined reference to 'alcCloseDevice'
CMakeFiles/sfml-audio.dir/AudioDevice.cpp.o:AudioDevice.cpp:function sf::priv::AudioDevice::setGlobalVolume(float): error: undefined reference to 'alListenerf'
CMakeFiles/sfml-audio.dir/AudioDevice.cpp.o:AudioDevice.cpp:function sf::priv::AudioDevice::setPosition(sf::Vector3<float> const&): error: undefined reference to 'alListener3f'
CMakeFiles/sfml-audio.dir/AudioDevice.cpp.o:AudioDevice.cpp:function sf::priv::AudioDevice::setDirection(sf::Vector3<float> const&): error: undefined reference to 'alListenerfv'
CMakeFiles/sfml-audio.dir/AudioDevice.cpp.o:AudioDevice.cpp:function sf::priv::AudioDevice::setUpVector(sf::Vector3<float> const&): error: undefined reference to 'alListenerfv'
CMakeFiles/sfml-audio.dir/AudioDevice.cpp.o:AudioDevice.cpp:function sf::priv::AudioDevice::AudioDevice(): error: undefined reference to 'alcOpenDevice'
CMakeFiles/sfml-audio.dir/AudioDevice.cpp.o:AudioDevice.cpp:function sf::priv::AudioDevice::AudioDevice(): error: undefined reference to 'alcCreateContext'
CMakeFiles/sfml-audio.dir/AudioDevice.cpp.o:AudioDevice.cpp:function sf::priv::AudioDevice::AudioDevice(): error: undefined reference to 'alcMakeContextCurrent'
CMakeFiles/sfml-audio.dir/AudioDevice.cpp.o:AudioDevice.cpp:function sf::priv::AudioDevice::AudioDevice(): error: undefined reference to 'alListenerf'
CMakeFiles/sfml-audio.dir/AudioDevice.cpp.o:AudioDevice.cpp:function sf::priv::AudioDevice::AudioDevice(): error: undefined reference to 'alListener3f'
CMakeFiles/sfml-audio.dir/AudioDevice.cpp.o:AudioDevice.cpp:function sf::priv::AudioDevice::AudioDevice(): error: undefined reference to 'alListenerfv'
CMakeFiles/sfml-audio.dir/AudioDevice.cpp.o:AudioDevice.cpp:function sf::priv::AudioDevice::getFormatFromChannelCount(unsigned int): error: undefined reference to 'alGetEnumValue'
CMakeFiles/sfml-audio.dir/AudioDevice.cpp.o:AudioDevice.cpp:function sf::priv::AudioDevice::getFormatFromChannelCount(unsigned int): error: undefined reference to 'alcMakeContextCurrent'
CMakeFiles/sfml-audio.dir/AudioDevice.cpp.o:AudioDevice.cpp:function sf::priv::AudioDevice::getFormatFromChannelCount(unsigned int): error: undefined reference to 'alcDestroyContext'
CMakeFiles/sfml-audio.dir/AudioDevice.cpp.o:AudioDevice.cpp:function sf::priv::AudioDevice::getFormatFromChannelCount(unsigned int): error: undefined reference to 'alcCloseDevice'
CMakeFiles/sfml-audio.dir/AudioDevice.cpp.o:AudioDevice.cpp:function sf::priv::AudioDevice::getFormatFromChannelCount(unsigned int): error: undefined reference to 'alGetEnumValue'
CMakeFiles/sfml-audio.dir/AudioDevice.cpp.o:AudioDevice.cpp:function sf::priv::AudioDevice::getFormatFromChannelCount(unsigned int): error: undefined reference to 'alGetEnumValue'
CMakeFiles/sfml-audio.dir/AudioDevice.cpp.o:AudioDevice.cpp:function sf::priv::AudioDevice::getFormatFromChannelCount(unsigned int): error: undefined reference to 'alGetEnumValue'
CMakeFiles/sfml-audio.dir/AudioDevice.cpp.o:AudioDevice.cpp:function sf::priv::AudioDevice::isExtensionSupported(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&): error: undefined reference to 'alIsExtensionPresent'
CMakeFiles/sfml-audio.dir/AudioDevice.cpp.o:AudioDevice.cpp:function sf::priv::AudioDevice::isExtensionSupported(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&): error: undefined reference to 'alcMakeContextCurrent'
CMakeFiles/sfml-audio.dir/AudioDevice.cpp.o:AudioDevice.cpp:function sf::priv::AudioDevice::isExtensionSupported(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&): error: undefined reference to 'alcDestroyContext'
CMakeFiles/sfml-audio.dir/AudioDevice.cpp.o:AudioDevice.cpp:function sf::priv::AudioDevice::isExtensionSupported(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&): error: undefined reference to 'alcCloseDevice'
CMakeFiles/sfml-audio.dir/AudioDevice.cpp.o:AudioDevice.cpp:function sf::priv::AudioDevice::isExtensionSupported(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&): error: undefined reference to 'alcIsExtensionPresent'
CMakeFiles/sfml-audio.dir/Sound.cpp.o:Sound.cpp:function sf::Sound::play(): error: undefined reference to 'alSourcePlay'
CMakeFiles/sfml-audio.dir/Sound.cpp.o:Sound.cpp:function sf::Sound::pause(): error: undefined reference to 'alSourcePause'
CMakeFiles/sfml-audio.dir/Sound.cpp.o:Sound.cpp:function sf::Sound::stop(): error: undefined reference to 'alSourceStop'
CMakeFiles/sfml-audio.dir/Sound.cpp.o:Sound.cpp:function sf::Sound::setBuffer(sf::SoundBuffer const&): error: undefined reference to 'alSourcei'
CMakeFiles/sfml-audio.dir/Sound.cpp.o:Sound.cpp:function sf::Sound::setLoop(bool): error: undefined reference to 'alSourcei'
CMakeFiles/sfml-audio.dir/Sound.cpp.o:Sound.cpp:function sf::Sound::setPlayingOffset(sf::Time): error: undefined reference to 'alSourcef'
CMakeFiles/sfml-audio.dir/Sound.cpp.o:Sound.cpp:function sf::Sound::getLoop() const: error: undefined reference to 'alGetSourcei'
CMakeFiles/sfml-audio.dir/Sound.cpp.o:Sound.cpp:function sf::Sound::getPlayingOffset() const: error: undefined reference to 'alGetSourcef'
CMakeFiles/sfml-audio.dir/Sound.cpp.o:Sound.cpp:function sf::Sound::resetBuffer(): error: undefined reference to 'alSourcei'
CMakeFiles/sfml-audio.dir/SoundBuffer.cpp.o:SoundBuffer.cpp:function sf::SoundBuffer::getSampleRate() const: error: undefined reference to 'alGetBufferi'
CMakeFiles/sfml-audio.dir/SoundBuffer.cpp.o:SoundBuffer.cpp:function sf::SoundBuffer::getChannelCount() const: error: undefined reference to 'alGetBufferi'
CMakeFiles/sfml-audio.dir/SoundBuffer.cpp.o:SoundBuffer.cpp:function sf::SoundBuffer::SoundBuffer(): error: undefined reference to 'alGenBuffers'
CMakeFiles/sfml-audio.dir/SoundBuffer.cpp.o:SoundBuffer.cpp:function sf::SoundBuffer::~SoundBuffer(): error: undefined reference to 'alDeleteBuffers'
CMakeFiles/sfml-audio.dir/SoundBuffer.cpp.o:SoundBuffer.cpp:function sf::SoundBuffer::update(unsigned int, unsigned int): error: undefined reference to 'alBufferData'
CMakeFiles/sfml-audio.dir/SoundBuffer.cpp.o:SoundBuffer.cpp:function sf::SoundBuffer::SoundBuffer(sf::SoundBuffer const&): error: undefined reference to 'alGenBuffers'
CMakeFiles/sfml-audio.dir/SoundRecorder.cpp.o:SoundRecorder.cpp:function sf::SoundRecorder::getDefaultDevice(): error: undefined reference to 'alcGetString'
CMakeFiles/sfml-audio.dir/SoundRecorder.cpp.o:SoundRecorder.cpp:function sf::SoundRecorder::getAvailableDevices(): error: undefined reference to 'alcGetString'
CMakeFiles/sfml-audio.dir/SoundRecorder.cpp.o:SoundRecorder.cpp:function sf::SoundRecorder::processCapturedSamples(): error: undefined reference to 'alcGetIntegerv'
CMakeFiles/sfml-audio.dir/SoundRecorder.cpp.o:SoundRecorder.cpp:function sf::SoundRecorder::processCapturedSamples(): error: undefined reference to 'alcCaptureSamples'
CMakeFiles/sfml-audio.dir/SoundRecorder.cpp.o:SoundRecorder.cpp:function sf::SoundRecorder::cleanup(): error: undefined reference to 'alcCaptureStop'
CMakeFiles/sfml-audio.dir/SoundRecorder.cpp.o:SoundRecorder.cpp:function sf::SoundRecorder::cleanup(): error: undefined reference to 'alcCaptureCloseDevice'
CMakeFiles/sfml-audio.dir/SoundRecorder.cpp.o:SoundRecorder.cpp:function sf::SoundRecorder::start(unsigned int): error: undefined reference to 'alcCaptureOpenDevice'
CMakeFiles/sfml-audio.dir/SoundRecorder.cpp.o:SoundRecorder.cpp:function sf::SoundRecorder::start(unsigned int): error: undefined reference to 'alcCaptureStart'
CMakeFiles/sfml-audio.dir/SoundRecorder.cpp.o:SoundRecorder.cpp:function sf::SoundRecorder::setDevice(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&): error: undefined reference to 'alcCaptureOpenDevice'
CMakeFiles/sfml-audio.dir/SoundRecorder.cpp.o:SoundRecorder.cpp:function sf::SoundRecorder::setDevice(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&): error: undefined reference to 'alcCaptureStart'
CMakeFiles/sfml-audio.dir/SoundSource.cpp.o:SoundSource.cpp:function sf::SoundSource::~SoundSource(): error: undefined reference to 'alSourcei'
CMakeFiles/sfml-audio.dir/SoundSource.cpp.o:SoundSource.cpp:function sf::SoundSource::~SoundSource(): error: undefined reference to 'alDeleteSources'
CMakeFiles/sfml-audio.dir/SoundSource.cpp.o:SoundSource.cpp:function sf::SoundSource::SoundSource(): error: undefined reference to 'alGenSources'
CMakeFiles/sfml-audio.dir/SoundSource.cpp.o:SoundSource.cpp:function sf::SoundSource::setPitch(float): error: undefined reference to 'alSourcef'
CMakeFiles/sfml-audio.dir/SoundSource.cpp.o:SoundSource.cpp:function sf::SoundSource::setVolume(float): error: undefined reference to 'alSourcef'
CMakeFiles/sfml-audio.dir/SoundSource.cpp.o:SoundSource.cpp:function sf::SoundSource::setPosition(float, float, float): error: undefined reference to 'alSource3f'
CMakeFiles/sfml-audio.dir/SoundSource.cpp.o:SoundSource.cpp:function sf::SoundSource::setMinDistance(float): error: undefined reference to 'alSourcef'
CMakeFiles/sfml-audio.dir/SoundSource.cpp.o:SoundSource.cpp:function sf::SoundSource::getPitch() const: error: undefined reference to 'alGetSourcef'
CMakeFiles/sfml-audio.dir/SoundSource.cpp.o:SoundSource.cpp:function sf::SoundSource::getVolume() const: error: undefined reference to 'alGetSourcef'
CMakeFiles/sfml-audio.dir/SoundSource.cpp.o:SoundSource.cpp:function sf::SoundSource::getPosition() const: error: undefined reference to 'alGetSource3f'
CMakeFiles/sfml-audio.dir/SoundSource.cpp.o:SoundSource.cpp:function sf::SoundSource::isRelativeToListener() const: error: undefined reference to 'alGetSourcei'
CMakeFiles/sfml-audio.dir/SoundSource.cpp.o:SoundSource.cpp:function sf::SoundSource::getMinDistance() const: error: undefined reference to 'alGetSourcef'
CMakeFiles/sfml-audio.dir/SoundSource.cpp.o:SoundSource.cpp:function sf::SoundSource::SoundSource(sf::SoundSource const&): error: undefined reference to 'alGenSources'
CMakeFiles/sfml-audio.dir/SoundSource.cpp.o:SoundSource.cpp:function sf::SoundSource::getStatus() const: error: undefined reference to 'alGetSourcei'
CMakeFiles/sfml-audio.dir/SoundStream.cpp.o:SoundStream.cpp:function sf::SoundStream::pause(): error: undefined reference to 'alSourcePause'
CMakeFiles/sfml-audio.dir/SoundStream.cpp.o:SoundStream.cpp:function sf::SoundStream::fillAndPushBuffer(unsigned int): error: undefined reference to 'alBufferData'
CMakeFiles/sfml-audio.dir/SoundStream.cpp.o:SoundStream.cpp:function sf::SoundStream::fillAndPushBuffer(unsigned int): error: undefined reference to 'alSourceQueueBuffers'
CMakeFiles/sfml-audio.dir/SoundStream.cpp.o:SoundStream.cpp:function sf::SoundStream::clearQueue(): error: undefined reference to 'alGetSourcei'
CMakeFiles/sfml-audio.dir/SoundStream.cpp.o:SoundStream.cpp:function sf::SoundStream::clearQueue(): error: undefined reference to 'alSourceUnqueueBuffers'
CMakeFiles/sfml-audio.dir/SoundStream.cpp.o:SoundStream.cpp:function sf::SoundStream::play(): error: undefined reference to 'alSourcePlay'
CMakeFiles/sfml-audio.dir/SoundStream.cpp.o:SoundStream.cpp:function sf::SoundStream::streamData(): error: undefined reference to 'alGenBuffers'
CMakeFiles/sfml-audio.dir/SoundStream.cpp.o:SoundStream.cpp:function sf::SoundStream::streamData(): error: undefined reference to 'alSourcePlay'
CMakeFiles/sfml-audio.dir/SoundStream.cpp.o:SoundStream.cpp:function sf::SoundStream::streamData(): error: undefined reference to 'alSourcePlay'
CMakeFiles/sfml-audio.dir/SoundStream.cpp.o:SoundStream.cpp:function sf::SoundStream::streamData(): error: undefined reference to 'alSourceUnqueueBuffers'
CMakeFiles/sfml-audio.dir/SoundStream.cpp.o:SoundStream.cpp:function sf::SoundStream::streamData(): error: undefined reference to 'alGetBufferi'
CMakeFiles/sfml-audio.dir/SoundStream.cpp.o:SoundStream.cpp:function sf::SoundStream::streamData(): error: undefined reference to 'alGetBufferi'
CMakeFiles/sfml-audio.dir/SoundStream.cpp.o:SoundStream.cpp:function sf::SoundStream::streamData(): error: undefined reference to 'alSourceStop'
CMakeFiles/sfml-audio.dir/SoundStream.cpp.o:SoundStream.cpp:function sf::SoundStream::streamData(): error: undefined reference to 'alDeleteBuffers'
CMakeFiles/sfml-audio.dir/SoundStream.cpp.o:SoundStream.cpp:function sf::SoundStream::streamData(): error: undefined reference to 'alSourcePause'
collect2: error: ld returned 1 exit status
make[2]: *** [lib/libsfml-audio.so] Error 1
make[1]: *** [src/SFML/Audio/CMakeFiles/sfml-audio.dir/all] Error 2
make: *** [all] Error 2
J'ai vu que CMake pouvait normalement gérer les requêtes de framework OSX et non nécessairement de librairies, mais il semble que ca ne fonctionne pas. J'ai cru comprendre que pour cela il fallait lui spécifier le chemin du framework avec une fonction spécifique (find_library), mais n'étant pas un grand spécialiste du fonctionnement de cmake je n'ai pas trop compris où cela est spécifié (au niveau de l'installation de cmake sur la machine ? au niveau du projet qui utilise cmake pour la compilation ?). J'ai jeté un oeil au fichier qui semble être appelé par le cmake au niveau du projet, et qui fait partie de l'installation cmake sur la machine : /Applications/CMake.app/Contents/share/cmake-3.3/Modules/FindOpenAL.cmake, mais dans les commentaires du concepteur du fichier il est spécifié qu'il devrait marcher avec les framework... De plus c'est la seule référence à OpenAL que j'ai vu dans les fichiers makefile/de config de cmake au niveau du répertoire dans lequel se trouve SFML...
Je ne sais pas si tout ceci est clair, est-ce qu'il faut que je change quelque chose en particulier dans la config de CMake/dans les fichiers de config de CMake internes au répertoire SFML où j'essaye de le compiler?
Merci beaucoup, bien cordialement.