![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCdCGG39V6jZWI7he4Bbo0K9iENtel31lQV4oGZBJnwWaGEh90dzRhhLdeVppYhTOjQQGGeaUxaIU76HbLt2N7uj71G6R9lnC1085_mvu8riFfSBzZUEmWHtYP93osXTIrz4ncsAVJyA/s320/pdaldev05.png)
To fix the compilation errors, the Windows library ws2_32.lib needs to be linked to the final executable. This can be done in the following steps:
- Add the library ws2_32 to the CMakeLists.txt file, as shown below.
- Run CMake to build the Visual Studio project files.
C:\> cmake -G"Visual Studio 15 2017 Win64" ..
The project files are generated. - Open up the solution project in Visual Studio. Then build the solution.
The project is successfully built and the executable is generated.