From the native stacktrace there, it looks like it was at least able to find and load the BASS_FX library. Just a guess, but perhaps the problem is that the BASS library isn't loaded yet. Have you made a BASS function call before you make the BASS_FX_GetVersion call? If not, you could try that and see if it makes a difference (it should at least ensure that the BASS library is loaded).
Regarding loading add-ons that provide support for additional file formats, you would generally use BASS_PluginLoad to load them. Is that not finding them?
Thanks Ian, that was the solution. I was really scratching my head because I was using the original code under Windows and it was working fine, so I wasn't searching in the right place. Indeed, I have to get the version of the main BASS library before being able to successfully get the version of the FX and MIX library.
My last question wasn't very precise, sorry for that. I'm trying to load plugins such as the FLAC plugin through Mono with the Bass.BASS_PluginLoad(pluginFilePath) method but I keep getting the BASS_ERROR_FILEOPEN error. I'm using the x64 plugin versions. Here is the stack trace:
Exception in Gtk# callback delegate
Note: Applications can use GLib.ExceptionManager.UnhandledException to handle the exception.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> MPfm.Sound.BassNetWrapper.BassNetWrapperException: An error has occured in Bass.Net: BASS_ERROR_FILEOPEN
at MPfm.Sound.BassNetWrapper.Base.CheckForError () [0x00000] in <filename unknown>:0
at MPfm.Sound.BassNetWrapper.Base.LoadPlugin (System.String pluginFilePath) [0x00000] in <filename unknown>:0
at MPfm.Player.Player.Initialize (MPfm.Sound.BassNetWrapper.Device device, Int32 mixerSampleRate, Int32 bufferSize, Int32 updatePeriod, Boolean initializeDevice) [0x00000] in <filename unknown>:0
at MPfm.Player.Player..ctor (MPfm.Sound.BassNetWrapper.Device device, Int32 mixerSampleRate, Int32 bufferSize, Int32 updatePeriod, Boolean initializeDevice) [0x00000] in <filename unknown>:0
at MainWindow.OnButton6Clicked (System.Object sender, System.EventArgs e) [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <filename unknown>:0
at System.Delegate.DynamicInvokeImpl (System.Object[] args) [0x00000] in <filename unknown>:0
at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) [0x00000] in <filename unknown>:0
at System.Delegate.DynamicInvoke (System.Object[] args) [0x00000] in <filename unknown>:0
at GLib.Signal.ClosureInvokedCB (System.Object o, GLib.ClosureInvokedArgs args) [0x00000] in <filename unknown>:0
at GLib.SignalClosure.Invoke (GLib.ClosureInvokedArgs args) [0x00000] in <filename unknown>:0
at GLib.SignalClosure.MarshalCallback (IntPtr raw_closure, IntPtr return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr invocation_hint, IntPtr marshal_data) [0x00000] in <filename unknown>:0
at GLib.ExceptionManager.RaiseUnhandledException(System.Exception e, Boolean is_terminal)
at GLib.SignalClosure.MarshalCallback(IntPtr raw_closure, IntPtr return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr invocation_hint, IntPtr marshal_data)
at Gtk.Application.gtk_main()
at Gtk.Application.Run()
at MPfm.MainClass.Main(System.String[] args)
The plugin files are inside the executable directory. They are in the same directory than the BASS FX and Mix libraries which are now loading fine, so they should be found in that directory. I tried using the full path and it gives the same error. I tried loading "libbassflac.so" and I also tried loading "bassflac.dll" with a Mono dllmap pointing to "libbassflac.so" but it still doesn't work. :-(
UPDATE: I have the same problem on Mac OS X and have tried the same solutions (loading the .dylib directly, making a dllmap, etc.). I am able to load the Mix and FX plugins though.
Thanks for your help, it is really appreciated.