FMOD is a commercial library not provide by Debian. It use to manage sound and music in C/C++ project.
This article describe how to install FMOD on your Debian system.
FMOD version 3.75
Get development library
Go to website officel http://www.fmod.org
Go to Download section and download FMOD 3 Programmers API version for Linux. You could get fmodapi375linux.tar.gz archive file.
Uncompress this archive file in your home directory ~/
Install library on your Debian system
What you must install
In the archive file, you can found lot of files. Only following files are usable with Debian:
- ~/fmodapi375linux/fmodapi375linux/api/libfmod-3.75.so
- ~/fmodapi375linux/fmodapi375linux/api/inc/*.h
libfmod-3.75.so : The library file
inc/*.h : The header files containing FMOD's prototype using by your compiler
libfmod-3.75.so library
Normal way, Debian packages install libraries in /usr/lib. In this case, we are going to install a non-maintaining library. So we install it in /usr/local/lib.
sudo cp ~/fmodapi375linux/api/libfmod-3.75.so /usr/local/lib/
Headers
Like previous case, headers are install in /usr/local/include instead /usr/include as normal way.
sudo cp ~/fmodapi375linux/api/include/*.h /usr/local/include/
Compilation
gcc
Add following options to your command line:
-I/usr/local/include -L/usr/local/lib -lfmod-3.75
KDevelop
- Open your C/C++ project
Go to Project > Project Options > configure" Options"
Add to "C / C++ Preprocessor Flags (CPPFLAGS)": -I/usr/local/include
Add to "C / C++ Linker editor flags (LDFLAGS)": -L/usr/local/lib -lfmod-3.75
Validate
- Create ~/testfmod directory
Create ~/testfmod/testfmod.c file like: testfmod.c
- From archive file, copy ~/fmodapi375linux/fmodapi375linux/media/chimes.wav to ~/testfmod/test.wav
Type following commandes:
cd ~/testfmod gcc -I/usr/local/include -L/usr/local/lib -lfmod-3.75 testfmod.c -o testfmod ./testfmod
We must listen test.wav file
Troubleshooting
FSOUND_Init can't initialize
under Debian, it's necessary to define FSOUND_SetOutput ( FSOUND_OUTPUT_ALSA ); See http://www.siteduzero.com/forum-83-356196-3310992-impossible-de-trouver-le-fichier-son.html#r3310992 (in french)
External links
http://www.fmod.org - Official Website
http://www.siteduzero.com/tutoriel-3-14156-jouer-du-son-avec-fmod.html - To Learn easily FMODv3 using (in french)
http://www.pathname.com/fhs/pub/fhs-2.3.html#USRLOCALLOCALHIERARCHY - Why do you install non-maintaining library in /usr/local/
