I installed FMOD and tried to build and run one simple app from the FMOD examples. That worked fine.
Now I am trying to add FMOD to my project in order to use it, for the first time. I get an errors like ["fmod.hpp" No such file or directory].
I tried to look for a step by step tutorial how to add FMOD to my project, but i did not find anything. I found this one
http://brockwoolf.com/how-to-use-dynami … using-fmod
But this does not help either.
Does anybody know how or where to get a step by step tutorial? I was looking but could not find anything.
- mintesa asked 8 years ago
Sorry, I just copy and pasted the lib names without thinking, you should link with "-lfmodexL_iphoneos" if you want the logging version of FMOD for the iPhone device (note "lib" and ".a" have been removed).
And yes if you want to use the FMOD C++ API the implementation files that include the FMOD headers must be .mm. The .mm files allow the use of C++ where as the normal .m files only support C.
I have a similar problem and I have done all of above (set up search paths to //Developer/FMOD Programmers……/ api/lib and …/inc as well as setting the ‘Other Linker Flags’ to ‘-lfmodexL_iphonesimulator’).
The playsound example compiles and launches and no problem.
However, when I create a very simple app to test the api, it won’t compile and gives me the following error message:
error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute‘ before ‘FMOD’.
The debugger points to the ‘namespace FMOD’ statement in fmod.hpp which I have an #import statement for in my view controller .h file (together with #import fmod_errors.h).
Thanks & brgds
Thanks. That helped. By changing the appDelegate.m file to .mm the compiler went further, but now it stops during linking, giving 6 error messages such as :
"FMOD::System::playSound(FMOD_CHANNELINDEX, FMOD::Sound*, bool, FMOD::Channel**)", referenced from:
-[FMODTestViewController buttonPressed:] in FMODTestViewController.o
"_FMOD_System_Create", referenced from:
FMOD::System_Create(FMOD::System**) in FMODTestViewController.o
…and 4 other similar ones.
Are you linking the FMOD lib into your app correctly? As I mentioned a couple of posts up you need to add "-lfmodexL_iphoneos" or "-lfmodexL_iphonesimulator" depending on which device you are targeting.
You can be clever and link with "-lfmodexL_$PLATFORM_NAME" which will resolve to the device you have selected. Also note that you should link with fmodexL… for debug and fmodex… for release, note the ‘L’ for the logging version to see info on the TTY.
There is only a couple of things you need to do.
Firstly in the properties for your project (or target) you scroll down to the "Search Paths" section and set the "Header Search Paths" and "Library Search Paths" to where you installed the SDK to, e.g. "/Developer/FMOD Programmers API iPhone/api/inc" and "/Developer/FMOD Programmers API iPhone/api/lib" respectively.
Now scroll down to the "Linking" section of the settings and specify "-llibfmodexL_iphoneos.a" if you want to use the logging version of FMOD for the iPhone device or perhaps "-llibfmodex_iphonesimulator.a" if you wanted to use the release version of FMOD for the simulator.
If you check the docs, under platform specific -> iPhone you can get details about the different libs to link with. Also note you need to link with the AudioToolbox and CoreAudio frameworks, FMOD depends on them.
That’s it, if you run into any problems let us know.
I went into those settings, and now i have only one error left which goes:
[color=red:1xwapp2y]library not found for -llibfmodexL_iphoneos.a[/color:1xwapp2y]
I changed the appropriate files to .mm extension also, that is correct i hope.
I also noticed that the FMOD examples have another tabs in the settings
for GCC 4.0, I dont have these tabs in my project.
Thank you for the help.
Please login first to submit.