本文介绍了交流电插座编程与CygWin的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我想用C编写使用Cygwin一个小的服务器/客户端程序,问题是,在Cygwin的gcc编译器似乎不包含与套接字编程的产生密切相关的标准头。当试图编译我的服务器程序,我得到:

HiI'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-programming. When trying to compile my server program, i get:

netinet/in.h: No such file or directory
sys/socket.h: No such file or directory
netdb.h: No such file or directory

这些是三个头位于cygwin的-enviorment其他地方?

Are these three headers located elsewhere in the CygWin-enviorment?

推荐答案

尝试使用-I编译器命令行选项来指定的头文件的路径。

Try using the -I compiler command line option to specify a path to the header files.

我的本地参考状态

-I dir
       Add the directory dir to the list of directories to be searched for
       header files.  Directories named by -I are searched before the
       standard system include directories.  If the directory dir is a
       standard system include directory, the option is ignored to ensure
       that the default search order for system directories and the
       special treatment of system headers are not defeated . 

这篇关于交流电插座编程与CygWin的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-27 19:42