I built a plugin that depends on fmodex.dll. The plugin itself works and I can use it in a standalone unity build. It doesn't work in the editor. I think that's because the editor itself has a dependency on fmodex.dll. So my plugin finds the fmodex.dll in the editors application folder. This doesn't work, because I compiled and linked against a different fmod version. So two questions:
Is there a way to force the plugin to use the correct fmodex.dll?
If that's not possible could someone tell me which version of fmod i have to link against? The version on the editors dll says it's 4.26.0, but i downloaded that version from the fmod site and the dll's file sizes don't match, so it seems to be some kind of special unity build. Or I'm just stupid, that's entirely possible. ;)
I now have a workaround for this problem. Although it would be a much nicer and cleaner solution if Unity would rely on an official released fmodex.dll.
The workaround is to delayLoad the fmodex.dll from your own dll. To do this you need to set a special linker option when building your dll. This alone won't save you, it will still throw the exception the first time you make a call to an fmod function.
To prevent that you have to specify a "delayHook" (http://msdn.microsoft.com/en-us/library/f0fkfy9y.aspx). In our case we only need to handle the "dliNotePreLoadLibrary" case and reroute the call to fmodex.dll to someothername.dll. Now we can include a renamed fmodex.dll (using the specific release that you linked your dll against) in our project root folder. When we start the editor it will try to load fmodex.dll the first time we make a call to any fmod function. Instead trying to load the unity fmodex.dll it will now load the correct dll. Here's the example code for the delayHook function.
Can you describe "not working" in more detail? (Unity won't start? crashes? )
Unity is using a custom build of fmod (based on 4.26), so using another vanilla (even 4.26) version of fmod could lead to a undefined behaviour. But if your not using AudioSource/Clips at all and only fmod::channels/sounds you should be fine (using 4.26). But again, I need some more details on the specific errors.
I had the same problem and solved it by renaming my version of FModEx.dll to FModE2.dll and changing every occurrence of that name inside both dlls, Ex and Event, with a Hex Editor.
A better description of this answer is also on this link: