seems to be missing. This is required to intialize the SPI object (which in OOP is called a constructor). Unfortunately it is not possible to check what you want to achieve from the code snipet that you posted and in which line the error was detected by the compiler ...
ok, understood. With this sketch you only want to setup the Teensy as a slave device that answers with received value plus 10, correct?
The code looks ok for that. I copied the code into my Arduino 1.8.15 and it compiled successfully for Nano and UNO.
However, when I gave it a try for "ESP32 Dev Module" the same error message appeared. Plus several further error messages which I assume should be also visible in your respective IDE window?!?
Reason is that definitions/declarations for certain data are missing for the respective hardware (SPCR, SPE, 'class SPIClass' has no member named 'attachInterrupt',...).
With Windows OS you can find hardware depending definitions usually in a directory like this C:\Users\ [Your UserName] \AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7\avr\include\avr. However, you have to "dive" a little bit deeper into your microcontroller hardware if you want to create files like that ...
If you want to avoid this I recommend to have a look at the following page for Teensy which might solve your problem (hopefully ):
I looked up AVR SPI lib to see how it is implemented. Actually it does not have a SPI::SPI declaration in the library that does any initialisation.
The SPI instance created there is only developped for use as SPI-Master, the initialization of the SPI library for this purpose always requires an explicit call of SPI.begin() as far as I see it.
For SPI Slave mode the direct interference with registers and writing of an interrupt routine is required (as seen above). The include of the SPI lib just eases access to hardware specific declarations. Especially the ISR macro is again something related to the specific hardware that can only be solved by enablng the correct architecture in the development environment ... unless someone wants to do the job for his/her specific processor on his/her own...