Linux build attempt - running into -fPIC trouble
I've had a go at building this on Linux. The standalone seems to build ok, but building VST3 with make AudioPluginExample_VST3 I'm consistently running into errors along the lines of
[100%] Linking CXX shared module "AudioPluginExample_artefacts/VST3/Daisy Plug-in Test.vst3/Contents/x86_64-linux/Daisy Plug-in Test.so"
/usr/bin/ld: DaisySP/libDaisySP.a(oscillator.cpp.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
I've tried setting CFLAGS and CPPFLAGS to "-fPIC" in various places to no avail. Do you have any thoughts on where the -fPIC might need to be inserted?
@ajjackson it looks like it wants DaisySP itself to be compiled with -fPIC as well.
You'll have to edit CMakeLists.txt file (or the resultant Makefile) to add it to the DaisySP CFLAGS and CXXFLAGS .
I think the actual in-repo DaisySP/Makefile is only set up for ARM Cross compilation.
I'm not sure I've tested this on Linux for the VST3, but I can probably slot out some time to confirm the VST3 build in general works sometime this week.
Thanks for taking a look! I added -fPIC to CXXFLAGS in plugin/build/DaisySP/CMakeFiles/DaisySP.dir/flags.make and this allowed me to build a VST3 demo which loads in REAPER and makes the expected shrieking oscillator noise :tada:
I expect there's a cleaner / more automatic way of doing it, but this will get me going :grinning: