# Sys headers - running Linux C code on windows

**URL:** <https://community.unix.com/t/sys-headers-running-linux-c-code-on-windows/339723>\
**Category:** Microsoft Windows\
**Created:** [February 14, 2014, 4:58am UTC](https://community.unix.com/t/sys-headers-running-linux-c-code-on-windows/339723 "2014-02-14T04:58:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![coolatt](https://community.unix.com/user_avatar/community.unix.com/coolatt/32/1380_2.png) [@coolatt](https://community.unix.com/u/coolatt)\
**Post date:** [February 14, 2014, 4:58am UTC](https://community.unix.com/t/sys-headers-running-linux-c-code-on-windows/339723/1 "2014-02-14T04:58:11Z")

</div>

Hi All,

I wanted to run a small socket application written in C on windows.

The code was written for GNU/linux..the compiler on windows CodeBlocks complains about the sys headers.

is there an equivalent for windows ?

---

<div class="post-metadata">

**Author:** ![Corona688](https://community.unix.com/letter_avatar/corona688/32/6_449c533f586939b6e5f246632a46421f.png) [@Corona688](https://community.unix.com/u/Corona688)\
**Post date:** [February 14, 2014, 10:31am UTC](https://community.unix.com/t/sys-headers-running-linux-c-code-on-windows/339723/2 "2014-02-14T10:31:03Z")

</div>

I cannot see your computer from here.

Please post your code.

It's sometimes possible for socket code to work in Windows if sockets are used in an extremely specific and rather limited way but more often separate code is written for each.

---

<div class="post-metadata">

**Author:** ![coolatt](https://community.unix.com/user_avatar/community.unix.com/coolatt/32/1380_2.png) [@coolatt](https://community.unix.com/u/coolatt)\
**Post date:** [February 14, 2014, 2:00pm UTC](https://community.unix.com/t/sys-headers-running-linux-c-code-on-windows/339723/3 "2014-02-14T14:00:12Z")

</div>

The code I was trying to run is taken from [this](http://www.tutorialspoint.com/unix_sockets/socket_server_example.htm) webpage.

i did not paste the code here as its wrapping & difficult to read.

---

<div class="post-metadata">

**Author:** ![Corona688](https://community.unix.com/letter_avatar/corona688/32/6_449c533f586939b6e5f246632a46421f.png) [@Corona688](https://community.unix.com/u/Corona688)\
**Post date:** [February 14, 2014, 2:46pm UTC](https://community.unix.com/t/sys-headers-running-linux-c-code-on-windows/339723/4 "2014-02-14T14:46:26Z")

</div>

You can easily post code here by using code tags,

````
```text
stuff
```
[/code]

````

.

If you wanted to compile unmodified UNIX code under Windows you could use cygwin.

---

<div class="post-metadata">

**Author:** ![coolatt](https://community.unix.com/user_avatar/community.unix.com/coolatt/32/1380_2.png) [@coolatt](https://community.unix.com/u/coolatt)\
**Post date:** [February 14, 2014, 3:21pm UTC](https://community.unix.com/t/sys-headers-running-linux-c-code-on-windows/339723/5 "2014-02-14T15:21:27Z")

</div>

Ok Corona..I will try what you suggested.
