Problem writing code for arduino-Ping library

Hello, I can ask for help on how to write the code correctly. The writing in the Arduino IDE is fine, but I don’t know how to write correctly for PlatromIO. This is the code from the examle glue GitHub - BlakeFoster/Arduino-Ping: ICMP ping library for the Arduino

#include <ICMPPing.h>
SOCKET pingSocket = 0;
char buffer [256];
ICMPPing ping(pingSocket, (uint16_t)random(0, 255));

loop {
const IPAddress remote_ip(192, 168, 2, 1);

ICMPEchoReply echoReply = ping(remote_ip, 1);
Serial.print("Remote IP : ");
Serial.println(echoReply.status);
}

I list only the affected parts of the code.
And I get these mistakes:

*C:/Users/borgm/OneDrive/Dokumenty/PlatformIO/Projects/WebMonitor/src/ESP8266_WebMon_V1.ino:744:5: error: 'ICMPEchoReply' was not declared in this scope
     ICMPEchoReply echoReply = ping(remote_ip, 1);
     ^
C:/Users/borgm/OneDrive/Dokumenty/PlatformIO/Projects/WebMonitor/src/ESP8266_WebMon_V1.ino:744:19: error: expected ';' before 'echoReply'
     ICMPEchoReply echoReply = ping(remote_ip, 1);
                   ^
C:/Users/borgm/OneDrive/Dokumenty/PlatformIO/Projects/WebMonitor/src/ESP8266_WebMon_V1.ino:746:20: error: 'echoReply' was not declared in this scope
     Serial.println(echoReply.status);*

Can anyone help me please?

Thank you

The library’s page says (GitHub - BlakeFoster/Arduino-Ping: ICMP ping library for the Arduino)

To use, copy the icmp_ping directory into the libraries directory of your Arduino folder.

So this library does not comfort to the standard arduino library structure.

To use it, please manually download the library as ZIP from the gitlab and put the icmp_ping folder in the lib/ folder of the project (so that the structure is now lib/icmp_ping/*source files*).

THX,
in the end it was my fault, I had a typo in the notation.
Unfortunately, after activating this library, the compilation is successfully completed, but ESP is rebooted. You have no idea what might be wrong now. The program otherwise worked well and stably for several days, until this library was added. I need to ping the router in combination with ESP8266 and ethernet (W5500 - lib. Ethernet3, ethernetwebserver v1.0.9). But I can’t find another library that supports this assembly, and this causes a restart.

13:44:15.285 -> ets Jan 8 2013,rst cause:2, boot mode:(3,6)
13:44:15.285 ->
13:44:15.285 -> load 0x4010f000, len 3456, room 16
13:44:15.285 -> tail 0
13:44:15.285 -> chksum 0x84
13:44:15.285 -> csum 0x84
13:44:15.285 -> va5432625
13:44:15.319 -> ~ld

Reset casue 2 is a fatal exception. Try adding the code shown in https://www.espressif.com/sites/default/files/documentation/esp8266_reset_causes_and_common_fatal_exception_causes_en.pdf to print the reset reason decoding at the beginning via serial in the setup(). Is there any stacktrace shown in the output?

Does the minimal sketch at Arduino-Ping/Ping.ino at master · BlakeFoster/Arduino-Ping · GitHub work?

Also if you have W5500: The library seems to be written for W5100?

Solution seems to be to use a different lib icmp ping and ethernet 2.0 doesn't work · Issue #16 · BlakeFoster/Arduino-Ping · GitHub

I had to use this branch, which was originally based on that library:

same bug

With the minimal example sketch provided by the library?

I tried more attempts because the library example worked. Finally, the order of the loaded libraries had to be changed and everything is already functional.

Thank you very much for your help.