I am trying to learn RPi dev
I cannot use an IDE on the RPi, because ultimately the RPi needs to run without a GUI (Incompatible with hardware I intend to use), so I want to use Visual Studio (or VSCode) on a Windows PC to to dev
I have followed Microsoft’s instructions here to to set up VS and am able to run “Hello World” code on the RPi by hitting F5 in VS – all good. I chose to use the CMake variant of the build chain as it seemed to be the recommended way for open source projects of this nature.
I then followed a tutorial to write some code directly on the Pi using Nano text editor (Not via VS) to light the LED (Using the WiringPi library) and got it working.
In this tutorial, it seems to use something other than cmake to compile:g++ -std=c++17 -o blink_led blink_led.cpp -lwiringPi
But, unsurprisingly, when I copied that code into VS on my PC and hit F5, it threw errors:

I am guessing it failed to link the WiringPi library?
IDK if it is relevant, but I clicked Update and then Explore in the Connection Manager, and I see the file that I guess it needs (wiringPi.h) in AppData\Local\Microsoft\Linux\HeaderCache\1.0\-1346357119\usr\include
Can anyone advise?
[Edit 01 – Added CMakeLists.txt]
Here is my CMakeLists.txt – it is just default, I have not modified it, because anything I tried to add threw an error
# CMakeList.txt : CMake project for CMakeProject1, include source and define
# project specific logic here.
#
cmake_minimum_required (VERSION 3.8)
# Enable Hot Reload for MSVC compilers if supported.
if (POLICY CMP0141)
cmake_policy(SET CMP0141 NEW)
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<IF:$<AND:$<C_COMPILER_ID:MSVC>,$<CXX_COMPILER_ID:MSVC>>,$<$<CONFIG:Debug,RelWithDebInfo>:EditAndContinue>,$<$<CONFIG:Debug,RelWithDebInfo>:ProgramDatabase>>")
endif()
project ("CMakeProject1")
# Add source to this project's executable.
add_executable (CMakeProject1 "CMakeProject1.cpp" "CMakeProject1.h")
if (CMAKE_VERSION VERSION_GREATER 3.12)
set_property(TARGET CMakeProject1 PROPERTY CXX_STANDARD 20)
endif()
# TODO: Add tests and install targets if needed.