code containing wifimanager dosent upload to nodeMCU

Hello everybody!
I was tryna upload this code into my nodeMCu

 #include <ESP8266WiFi.h>          //ESP8266 Core WiFi Library (you most likely already have this in your sketch)
 #include <DNSServer.h>            //Local DNS Server used for redirecting all requests to the configuration portal
#include <ESP8266WebServer.h>     //Local WebServer used to serve the configuration portal
#include <WiFiManager.h>   


void setup() {
 
WiFiManager wifiManager;
//first parameter is name of access point, second is the password
wifiManager.autoConnect("", "");
wifiManager.autoConnect();
}

void loop() {
  
}

it shows this error message

Arduino: 1.8.7 (Windows Store 1.8.15.0) (Windows 10), Board: "NodeMCU 0.9 (ESP-12 Module), 80 MHz, Flash, 4M (1M SPIFFS), v2 Lower Memory, Disabled, None, Only Sketch, 115200"

libraries\WiFiManager-master\WiFiManager.cpp.o: In function `String::operator+=(String const&)':

C:\Users\MEHARR\Documents\Arduino\libraries\WiFiManager-master/WiFiManager.cpp:891: undefined reference to `WPS_is_unavailable_in_this_configuration__Please_check_FAQ_or_board_generator_tool'

libraries\WiFiManager-master\WiFiManager.cpp.o: In function `WiFiManager::startWPS()':

C:\Users\MEHARR\Documents\Arduino\libraries\WiFiManager-master/WiFiManager.cpp:891: undefined reference to `WPS_is_unavailable_in_this_configuration__Please_check_FAQ_or_board_generator_tool'

collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling for board NodeMCU 0.9 (ESP-12 Module).

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

now when i try to upload any other code into it…Guess what?..gets uploaded!!!
could you please help me here
Thank you in advance

it is a compilation problem, not an upload problem

Thanks Juraj for your prompting reply...
could you please suggest the possible reason and solution for this?

do you have the latest esp8266 Arduino core?

Compiles just fine for me !
but keep in mind that in the example it says

   wifiManager.autoConnect("AutoConnectAP");
    //or use this for auto generated name ESP + ChipID
    //wifiManager.autoConnect();

or why would you want to create one with a name (or without one as you are doing) and then change you mind and use the auto-generated ESP+chipID ?

Thanks Deva_Rishi
but when i compiled the same example(the one you are refering to),it shows the same error message there

sabishaw:
Thanks Deva_Rishi
but when i compiled the same example(the one you are refering to),it shows the same error message there

check reply #3 might be that your issue is related to that

could you please elaborate what you want me to do...lol

@Juraj
i just now updated my board in boards manager .......if thats what you anted me to do.....the ....it didnt work even now.....

sabishaw:
lol

??
And the WifiManager.h & .cpp (i’m not even sure that there are more versions of it…)
I can’t explain your issue unless either the library is not current, or the code you posted is not the actual code.

The code i posted isnt working,nor any other code which uses object of WiFimanager,.....i.e. any example code of wifimanager isnt compiling either as for wifimanager.h or.cpp i searched for it in my pc and they happen to be there in the file,....if thats what you mean.....
thanks Deva_Rishi!

sabishaw:
as for wifimanager.h or.cpp i searched for it in my pc and they happen to be there in the file,....if thats what you mean.....

That is what i mean, download WifiManager again from GitHub and replace the file in your library folder.
If that doesn't work do the same for the other libraries that are included in the examples (WifiManager depends on them) Check to make sure there is not a stray version of any of them somewhere. (as a last resort..)

hey thanks.....i'll do it now

didnt work and my head is about to blast!!!!

Rest your head... i Checked your error code again..

libraries\WiFiManager-master\WiFiManager.cpp.o: In function `String::operator+=(String const&)':

C:\Users\MEHARR\Documents\Arduino\libraries\WiFiManager-master/WiFiManager.cpp:891: undefined reference to `WPS_is_unavailable_in_this_configuration__Please_check_FAQ_or_board_generator_tool'

as far as i know this : WiFiManager.cpp:891 refers to line 891 of WifiManager.cpp, but my WifiManager.cpp only has 804 lines ! it mus be referring to a different file, what is in the project folder ? Is there any other WifiManager.h in the Libraries folder or sub folders ? (that the subfolder is named something else is not important)

damn!!!!
thanks Deva_Rishi....you are right.....it worked now...
i deleted both the files and downloaded new one......
Man! thank you,I was really doomed by being stuck there......
I wish someday I could be of some use to you...
I wonder why a guy like you has so less karmas...
i ma add another one now...
stay safe...
bye

Yahoo, you had me worried you know,,,