Im on OSX, trying to learn the FMOD EventSystem API, whilst taking my first feeble steps into C++ here. So any help would be appreciated.

I’ve made a simple .fev with only one event. the project builds just fine.

Then I’ve used the ‘simple_event’ as a starting point for importing my own .fev file. This is what I have so far:


include "inc/wincompat.h"

include "inc/fmod_event.hpp"

include "inc/fmod_errors.h"

include <iostream>

if(result != FMOD_OK)
printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result));

int main()

FMOD::EventSystem   *eventsystem;
FMOD::Event         *event;
FMOD::EventGroup    *group;
FMOD_RESULT         result;

ERRCHECK(result = eventsystem-&gt;init(64, FMOD_INIT_NORMAL, 0, FMOD_EVENT_INIT_NORMAL));
ERRCHECK(result = eventsystem-&gt;setMediaPath(&quot;media/&quot;));
ERRCHECK(result = eventsystem-&gt;load(&quot;test.fev&quot;, 0, 0));
ERRCHECK(result = eventsystem-&gt;getGroup(&quot;test/bell&quot;, FMOD_EVENT_DEFAULT, &amp;group));
ERRCHECK(result = group-&gt;getEvent(&quot;thing&quot;, FMOD_EVENT_DEFAULT, &amp;event));

ERRCHECK(result = event-&gt;start());
std::cout &lt;&lt; &quot;event started&quot;;
ERRCHECK(result = event-&gt;stop());
std::cout &lt;&lt; &quot;event stopped&quot;;

return 0;



I use this line to compile:
g++ -03 -o Test Test.cpp ./libfmodevent.dylib ./libfmodex.dylib -I inc/

The inc/ folder is where the .h files a stored and the .dylib files are stored in the same folder as Test.cpp

This compiles just fine. But when I run the executable i get the error message
FMOD error! (37) An invalid parameter was passed to this function.

After some debugging I found that this line is generating the error:

ERRCHECK(result = group->getEvent("thing", FMOD_EVENT_DEFAULT, &event));

I found that if I do:
sudo ./Test

the program works.

Not really sure if this really is a question related to FMOD Event API, but I’m posting here in case someone else has had similar experiences. I’m thinking this has to do with some permission settings for the files when building or compiling? The same thing happens when I try to run the ‘simple_event’ example.

Is there any reason why I have to execute the program with sudo, or are there any chages I can make in order to run this program with other privileges?

  • You must to post comments
Showing 0 results
Your Answer

Please first to submit.