Build failure with SFIZZ_USE_SNDFILE=ON
iv-m opened this issue · 1 comments
iv-m commented
I'm trying to build sfizz from the current develop branch (commit 77fbfa5) with -DSFIZZ_USE_SNDFILE=ON, and the build fails.
I see two problems. First, AudioReader.cpp
fails to compile:
[path to]/sfizz/src/sfizz/AudioReader.cpp: In member function ‘virtual bool sfz::BasicSndfileReader::getInstrumentInfo(sfz::InstrumentInfo&)’:
[path to]/sfizz/src/sfizz/AudioReader.cpp:73:28: error: cannot convert ‘sfz::InstrumentInfo’ to ‘SF_INSTRUMENT*’ in initialization
73 | SF_INSTRUMENT* sfins = instrument;
| ^~~~~~~~~~
| |
| sfz::InstrumentInfo
gmake[2]: *** [src/CMakeFiles/sfizz_internal.dir/build.make:132: src/CMakeFiles/sfizz_internal.dir/sfizz/AudioReader.cpp.o] Error 1
This can be trivially fixed by adding &
to take the address of instrument
, which is reference, not pointer in this context.
Second, I get the linker errors like this:
ld: in function `sfz::Synth::Impl::handleSampleOpcodes(std::vector<sfz::Opcode, std::allocator<sfz::Opcode> > const&)':
[path to]/sfizz/external/st_audiofile/src/st_audiofile.hpp:103: undefined reference to `st_open_memory'
Indeed, the only implementation of st_open_memory is in st_audiofile.c
, and is compiled only
#if !defined(ST_AUDIO_FILE_USE_SNDFILE)
paulfd commented
Thanks, I'll look into that.