Ancurio / mkxp

Free Software implementation of the Ruby Game Scripting System (RGSS)
GNU General Public License v2.0
509 stars 128 forks source link

Fluidsynth-related compilation error on Arch Linux #219

Closed kforney closed 5 years ago

kforney commented 5 years ago

I received the following error while attempting to compile mkxp on Arch Linux:

/data/devel/arch/AUR/mkxp-git/src/mkxp/src/fluid-fun.cpp: In function ‘void initFluidFunctions()’:                                                                                           
/data/devel/arch/AUR/mkxp-git/src/mkxp/src/fluid-fun.h:42:49: error: invalid conversion from ‘void (*)(fluid_synth_t*)’ {aka ‘void (*)(_fluid_synth_t*)’} to ‘DELETEFLUIDSYNTHPROC’ {aka ‘int (*)(_fluid_synth_t*)’} [-fpermissive]
  FLUID_FUN2(delete_synth, DELETEFLUIDSYNTHPROC, delete_fluid_synth)
                                                 ^~~~~~~~~~~~~~~~~~
/data/devel/arch/AUR/mkxp-git/src/mkxp/src/fluid-fun.cpp:35:15: note: in definition of macro ‘FLUID_FUN2’                                                                                    
  fluid.name = real_name;
               ^~~~~~~~~
/data/devel/arch/AUR/mkxp-git/src/mkxp/src/fluid-fun.cpp:55:1: note: in expansion of macro ‘FLUID_FUNCS2’                                                                                    
 FLUID_FUNCS2
 ^~~~~~~~~~~~
make[2]: *** [CMakeFiles/mkxp.dir/build.make:713: CMakeFiles/mkxp.dir/src/fluid-fun.cpp.o] Error 1                                                                                           
make[1]: *** [CMakeFiles/Makefile2:73: CMakeFiles/mkxp.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

If it matters, my FluidSynth version is 2.0.4.

Ancurio commented 5 years ago

Looks like the signature changed in version 2.0, so I'd expect it to stay stable now. Best way is probably to single out the destructor and reinterpret_cast the function pointer, so we still compile with earlier versions.

Ancurio commented 5 years ago

Actually scratch that, the source incompatibility is only an issue if compilation is done with FLUID_SHARED enabled (ie. directly linking); since the default mode (dlsym'ing) still works regardless, I think it's reasonable to expect people wishing to link directly to have the most recent fluidsynth present.