C Socket Programming with CygWin - Stack Overflow
C Socket Programming with CygWin - Stack Overflow
Asked 14 years, 2 months ago Modified 6 years, 1 month ago Viewed 16k times
Hi I'm trying to write a little server / client program in C using CygWin, problem is, the gcc
compiler in Cygwin doesn't seem to contain the standard headers assosiated with socket-
4 programming. When trying to compile my server program, i get:
c sockets cygwin
Share Improve this question Follow asked Nov 12, 2010 at 6:45
LightBulb
41 1 1 2
They don't show up under /usr/include ? – Ignacio Vazquez-Abrams Nov 12, 2010 at 7:03
yes, they are where they're supposed to be, under /usr/include/sys, netinet... but compiler doesnt find
them? – LightBulb Nov 12, 2010 at 7:12
Try reinstalling the compiler, it's clearly a broken install. – Steve-o Nov 13, 2010 at 14:52
I also had same problem.. i was googling for hours and finally found this... thanks to ralph...
https://ralphexe.wordpress.com/2015/09/09/run-unix-socket-program-in-windows-using-
4
cygwin/
For socket commands you have to include some of the packages in cygwin while installing...
(If you have installed try reinstalling ...)
2. Expand DEVEL
This must be an accepted answer. Still valid in 2024 – Mike Apr 18, 2024 at 17:07
Try using the -I compiler command line option to specify a path to the header files.
Share Improve this answer Follow answered Nov 12, 2010 at 8:09
Niels Castle
8,069 37 58
NG:
0
$ gcc -mno-cygwin -o echo_server.exe echo_server.c
echo_server.c:12:43: sys/socket.h: No such file or directory
echo_server.c:13:24: netinet/in.h: No such file or directory
OK:
Share Improve this answer Follow answered Apr 28, 2014 at 7:42
user3580382
1
I had this problem for days with the library apophenia . so make sure the libraries you've
installed have first been configured with a simple command
0
./configure
once configured use the following commands to build , Install and check the libraries
Hope it helps. :)