Need help creating a global DMA helper to make DMA-based libraries (SPI, I2C...)

Hi,
I'm working on a DMA-based SPI library (github link), which use global DMA stuff. I've been able to make it work but there are a few issue that I can't manage to solve. The main one is that I can't define the DMA_SPI class function in a cpp file, I have to put the definitions in the header otherwise the code won't compile...
Any help would really be appreciated...