The proper way to link the debug library in C#

I’m curious as to the proper way to set FMOD to use the debug library instead of the release library? We’re using a custom C# engine (not Unity) and have been using a hack for quite a while to get it to load the debug library.

In fmod.cs I’ve updated the VERSION partial class to the following:

    public partial class VERSION
    {
        public const int    number = 0x00020123;
#if !UNITY_2017_4_OR_NEWER
	#if DEBUG
		public const string dll = "fmodL";
	#else
		public const string dll    = "fmod";
	#endif
#endif
	}

This works perfectly fine, as I’m linking against the proper dll based on whether the DEBUG flag is set in my FMODWrapper csproj. However, directly editing the FMOD source is not the proper fix here, so I was wondering what the intended method for this is?

Note: I’m working in Visual Studio, using FMOD 2.01.23

That would be the way to do it.
We haven’t included this because the preprocessor define will need to be maintained by the user and, outside of Unity, could be already setup as just about anything.

I have created a task to add this, then the user could either rename the define or add it to their project.

1 Like