Question

I need to create librtaudio.dylib, a dynamically loadable RtAudio library (http://www.music.mcgill.ca/~gary/rtaudio/). I'd like to write CFFI bindings (in SBCL) but I can't seem to compile a dylib that is loadable using CFFI. Here are the compiler and linker commands I'm using to create the dylib:

g++ -O2 -Wall -Iinclude -fPIC -DHAVE_GETTIMEOFDAY -D__MACOSX_CORE__ -c RtAudio.cpp -o RtAudio.o

g++ -dynamiclib -install_name /usr/local/lib/librtaudio.dylib -lSystem -compatibility_version 1.0 -current_version 1.0 RtAudio.o -o librtaudio.dylib -lpthread -framework CoreAudio -framework CoreFoundation

Was it helpful?

Solution

It seems that CFFI's C++ support is not adequate to load RtAudio, as it is a C++ lib. A workaround is to write a C wrapper around RtAudio and then write bindings to the wrapper.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top