0

I recently installed MinGW to be able to compile in C ++ on Visual Studio Code. Normal compilation works, but now I would need to run code containing sockets. To do this, I should include the following compiler and linker commands inserted in Dev-C ++ on VS Code.

Compiler commands: -lwsock32

Linker commands: -static-libgcc -std=c99 -lwsock32

What is the correct way to do this? Thanks in advance!

  • If you use the default you need to edit your `tasks.json` to supply additional compiler arguments. The documentation is here: [https://code.visualstudio.com/docs/cpp/config-msvc#_build-helloworldcpp](https://code.visualstudio.com/docs/cpp/config-msvc#_build-helloworldcpp) if you are using coderunner or some other extension the directions are different. – drescherjm Feb 08 '22 at 16:26
  • 1
    IMHO -std=c99 is a compiler flag and -lwsock32 is a linker flag. For a single build command you may use all them merged in one. – 273K Feb 08 '22 at 16:30

0 Answers0