Problem with callback function in ESP32 wifi library

the compiler gave you a clue...

for more info, do yourself a favour and please read How to get the best out of this forum and provide necessary documentation of your ask.