Help with adding custom .cpp files

I am trying to compile clouds with a custom build effect. The custom effect is part of a library I developed and hence, is located in a separate folder outside of the mutable instruments dev environment. I’ve made some headway getting it all to work, but currently am stuck on figuring out how to properly include and link the .cpp files from my library. Steps I have done so far:

  1. In Vagrantfile I have adjusted the config.vm.synced_folder variable so that my library is shared to the VM. This worked, as the content of my folder is visible within the VM
  2. Since my library uses some C++17 features I had to update gcc. I downloaded and installed gcc 9 and changed TOOLCHAIN_PATH ?= /usr/local/gcc-arm-none-eabi-9-2020-q2-update/ in clouds/makefile. This wasn’t enough to get things to compile though, I had to make a couple of small changes in some source files in the stmlib folder, but after having done that I could compile the original clouds module (without my custom modifications) successfully.

I am now at the point where I can import a class from my lib and create a new instance (ignoring some problems with relative import paths in my lib I couldn’t quite figure out as well, but could make work with some modifications to includes in my lib). However, when I try to call an instance method on one of my objects I get a linker error:

/usr/local/gcc-arm-none-eabi-9-2020-q2-update/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld: build/clouds/clouds.o: in function `FillBuffer(clouds::Codec::Frame*, clouds::Codec::Frame*, unsigned int)':

/vagrant/eurorack-modules/clouds/clouds.cc:97: undefined reference to `md_audio::ReverseDelay::perform(float)'

/usr/local/gcc-arm-none-eabi-9-2020-q2-update/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld: /vagrant/eurorack-modules/clouds/clouds.cc:97: undefined reference to `md_audio::ReverseDelay::perform(float)'

/usr/local/gcc-arm-none-eabi-9-2020-q2-update/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld: /vagrant/eurorack-modules/clouds/clouds.cc:97: undefined reference to `md_audio::ReverseDelay::perform(float)'

/usr/local/gcc-arm-none-eabi-9-2020-q2-update/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld: /vagrant/eurorack-modules/clouds/clouds.cc:97: undefined reference to `md_audio::ReverseDelay::perform(float)'

/usr/local/gcc-arm-none-eabi-9-2020-q2-update/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld: /vagrant/eurorack-modules/clouds/clouds.cc:97: undefined reference to `md_audio::ReverseDelay::perform(float)'

/usr/local/gcc-arm-none-eabi-9-2020-q2-update/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld: build/clouds/clouds.o:/vagrant/eurorack-modules/clouds/clouds.cc:97: more undefined references to `md_audio::ReverseDelay::perform(float)' follow

collect2: error: ld returned 1 exit status

make: *** [build/clouds/clouds.elf] Error 1

Could someone perhaps tell me how I properly link .cpp files that are located inside another (external) folder? I am sure I need to add some extra config for this to stmlib/makefile.inc and / or clouds/makefile, but I can’t quite figure out what needs to be done here.

Just for reference; I finally figured out how to get it working. Had to make a couple of adjustments and additions to stmlib/makefile.inc and clouds/makefile. My lib seems to compile fine now (so far anyway).