0

I coding a C++ WiringPi (Linux) project using these libraries:

#include <arpa/inet.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <unistd.h>
#include <signal.h>

I am on Windows and I'm getting a "'sys/socket.h': No such file or directory" error. I know Windows doesn't have sys/socket.h, arpa/inet.h etc but if I don't have files I'm getting a lot of unnecessary errors and intellisense isn't working.

Is it possible to solve this problem?

Laurel
  • 5,965
  • 14
  • 31
  • 57
  • Not possible I guess. You need to use Windows specific functions. – kiner_shah Jan 02 '22 at 06:53
  • I can't use windows functions because i coding for raspberry os (linux) – KFKLoaders Jan 02 '22 at 07:02
  • 1
    Then you have to use MinGW GCC compiler in order to access those files. But I am not sure if it's possible to integrate MinGW with Visual Studio (may work with Visual Studio Code though). – kiner_shah Jan 02 '22 at 07:05
  • @kiner_shah it seems possible: https://devblogs.microsoft.com/cppblog/using-mingw-and-cygwin-with-visual-cpp-and-open-folder/ – David Ranieri Jan 02 '22 at 07:07
  • @DavidRanieri, ohh amazing, that's convenient. :-) – kiner_shah Jan 02 '22 at 07:08
  • If you build on remote PC, consider adjusting `copyAdditionalIncludeDirectoriesList` vendor property. https://learn.microsoft.com/en-us/cpp/build/cmake-presets-json-reference?view=msvc-160#visual-studio-remote-settings-vendor-map – Osyotr Jan 02 '22 at 13:32

0 Answers0