Collect2.exe: error: ld returned 1 exit status *** [.pio\build\d1\firmware.elf] Error 1

Move the files Switch.cpp and UpnpBroadcastResponder.cpp to the src folder. Then it should work – or you should at least make progress.

include and src belong togehter. lib should only contain directories with further subdirectories.