[C#] Unbalanced Stack?


(Dumativa) #1

Hello,

I’m having trouble migrating from FMOD4 to FMOD5 using the c# wrapper.
In fmod4 everything was working just fine, but with fmod5 every single function call that I make returns me a strange error.

Some research later I found that I could try adding

CharSet = CharSet.Auto, CallingConvention = CallingConvention.Cdecl)]

To the [DllImport(VERSION.dll)] the error persisted.

Is there anything else I can try to do to fix it? Am I doing something wrong?


(Nicholas Wilcox) #2

All FMOD API functions are stdcall, which is the default calling convention of pInvoke.

Please make sure you use a matching version of the fmod.dll and fmod.cs.

If you still have problems please let tell us the version of the .net framework you are targeting, which runtime (microsoft, mono), which visual studio version, and if it’s desktop, phone, or windows app store.