Undeclared Identifier with TF1 objects in functions defined with Lambda expressions

The Undeclared Identifier error means you need to add an include.

#include "TF1.h"

Alas, this is being run on the command prompt (copy and paste it in yourself to try it) so everything is already included. If you run the guts of the function, it works, but if you run the function, it doesn’t.

Like this thread, I am using the constructor for TF1 utilizing a lambda function as a string.

My bad, I changed that to debug the undeclared identifier error, but fixing that does not solve the overall issue.