# Problem with callback function in ESP32 wifi library

**URL:** <https://forum.arduino.cc/t/problem-with-callback-function-in-esp32-wifi-library/917329>\
**Category:** General Guidance\
**Created:** [October 22, 2021, 8:26am UTC](https://forum.arduino.cc/t/problem-with-callback-function-in-esp32-wifi-library/917329 "2021-10-22T08:26:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![aji](https://avatars.discourse-cdn.com/v4/letter/a/bbe5ce/32.png) [@aji](https://forum.arduino.cc/u/aji)\
**Post date:** [October 22, 2021, 8:26am UTC](https://forum.arduino.cc/t/problem-with-callback-function-in-esp32-wifi-library/917329/1 "2021-10-22T08:26:35Z")

</div>

Hi,

I'm using ESP3, but it is not accepting callback functions. can anyone suggest me to resolve the issue so that i can able to gwt command from IBM cloud to ESP32.

sketch\_oct20a:42:35: error: 'callback' was not declared in this scope  
PubSubClient client(server, 1883, callback, wifiClient);  
^  
Multiple libraries were found for "WiFi.h"  
Used: C:\Users\I2785\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\libraries\WiFi  
Not used: C:\Program Files (x86)\Arduino\libraries\WiFi  
exit status 1  
'callback' was not declared in this scope

---

<div class="post-metadata">

**Author:** ![J-M-L](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/j-m-l/32/766245_2.png) [@J-M-L](https://forum.arduino.cc/u/J-M-L)\
**Post date:** [October 22, 2021, 9:04am UTC](https://forum.arduino.cc/t/problem-with-callback-function-in-esp32-wifi-library/917329/2 "2021-10-22T09:04:08Z")

</div>

the compiler gave you a clue...

> [@aji](#):
>
> `callback` was not declared in this scope

for more info, do yourself a favour and please read [How to get the best out of this forum](https://forum.arduino.cc/t/how-to-get-the-best-out-of-this-forum/679966) and provide necessary documentation of your ask.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [April 20, 2022, 9:04am UTC](https://forum.arduino.cc/t/problem-with-callback-function-in-esp32-wifi-library/917329/3 "2022-04-20T09:04:43Z")

</div>

Closed on April 20, 2022, 9:04am UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
