I’ve started the challenge; cloned the repository on Windows machine, uncommented a bunch of code and tried to build it with CodeBlocks, and immediately getting:
||=== Build: Debug in Codecrafters HTTP Server in C (compiler: GNU GCC Compiler) ===|
C:\Users\demenchuk\Documents\CodeCrafters\Build your own HTTP server\codecrafters-http-server-c\app\server.c|3|fatal error: sys/socket.h: No such file or directory|
||=== Build failed: 1 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|
A bit of StackOverflow says to me that issue seems to be that code uses UNIX/Linux library. Any advice on what to do on this step other than moving to Linux (which I can’t do)?
As long as you run the command within WSL, I think it should just work out of the box. Re: windows, I think you might be able to conditionally load windows-specific headers, but honestly don’t know enough about this to give you a proper answer. Our test runners run linux so even if you do use windows headers, you’ll definitely need conditional code that uses linux headers if the environment is linux.
We’re looking into what we can do to make using CodeCrafters on Windows easier - our first step here would be to make our CLI installable on windows. The CLI runs tests remotely (fast enough to feel local) - so you won’t need to use any windows-specific code.
Thanks for the reply, then. I’ll try to install WSL on my computer and then try to complete that challenge within it; I’ll ask additional questions within this thread, if I encounter any issues.