# Running "Build your own HTTP server" challenge in C on Windows machine

**URL:** <https://forum.codecrafters.io/t/running-build-your-own-http-server-challenge-in-c-on-windows-machine/2391>\
**Category:** Challenges\
**Tags:** challenge:http-server\
**Created:** [October 15, 2024, 11:58am UTC](https://forum.codecrafters.io/t/running-build-your-own-http-server-challenge-in-c-on-windows-machine/2391 "2024-10-15T11:58:17Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![TaosMonk](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/taosmonk/32/2373_2.png) [@TaosMonk](https://forum.codecrafters.io/u/TaosMonk)\
**Post date:** [October 15, 2024, 11:58am UTC](https://forum.codecrafters.io/t/running-build-your-own-http-server-challenge-in-c-on-windows-machine/2391/1 "2024-10-15T11:58:17Z")

</div>

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](https://stackoverflow.com/questions/22432910/makefile-error-sys-socket-h-no-such-file-or-directory-under-windows) 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)?

---

<div class="post-metadata">

**Author:** ![rohitpaulk](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/rohitpaulk/32/6_2.png) [@rohitpaulk](https://forum.codecrafters.io/u/rohitpaulk)\
**Post date:** [October 15, 2024, 12:01pm UTC](https://forum.codecrafters.io/t/running-build-your-own-http-server-challenge-in-c-on-windows-machine/2391/2 "2024-10-15T12:01:10Z")

</div>

@TaosMonk are you able to run WSL?

---

<div class="post-metadata">

**Author:** ![TaosMonk](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/taosmonk/32/2373_2.png) [@TaosMonk](https://forum.codecrafters.io/u/TaosMonk)\
**Post date:** [October 15, 2024, 12:06pm UTC](https://forum.codecrafters.io/t/running-build-your-own-http-server-challenge-in-c-on-windows-machine/2391/3 "2024-10-15T12:06:36Z")

</div>

Given that this is a work/corporate computer, I am not fully sure that I can. But if I can, what are my steps to solve this issue then?

---

<div class="post-metadata">

**Author:** ![rohitpaulk](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/rohitpaulk/32/6_2.png) [@rohitpaulk](https://forum.codecrafters.io/u/rohitpaulk)\
**Post date:** [October 15, 2024, 12:16pm UTC](https://forum.codecrafters.io/t/running-build-your-own-http-server-challenge-in-c-on-windows-machine/2391/4 "2024-10-15T12:16:59Z")

</div>

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](https://docs.codecrafters.io/cli/usage#how-do-i-use-the-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.

---

<div class="post-metadata">

**Author:** ![TaosMonk](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/taosmonk/32/2373_2.png) [@TaosMonk](https://forum.codecrafters.io/u/TaosMonk)\
**Post date:** [October 15, 2024, 12:22pm UTC](https://forum.codecrafters.io/t/running-build-your-own-http-server-challenge-in-c-on-windows-machine/2391/5 "2024-10-15T12:22:34Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![andy1li](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/andy1li/32/10_2.png) [@andy1li](https://forum.codecrafters.io/u/andy1li)\
**Post date:** [October 24, 2024, 3:21pm UTC](https://forum.codecrafters.io/t/running-build-your-own-http-server-challenge-in-c-on-windows-machine/2391/6 "2024-10-24T15:21:31Z")

</div>

Closing this thread due to inactivity. If you still need assistance, feel free to reopen or start a new discussion!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/3X/7/0/700657133935c15703e22c7c8870394f6e6dc27d.svg) [@system](https://forum.codecrafters.io/u/system)\
**Post date:** [October 29, 2024, 3:22pm UTC](https://forum.codecrafters.io/t/running-build-your-own-http-server-challenge-in-c-on-windows-machine/2391/7 "2024-10-29T15:22:13Z")

</div>

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.
