VS 错误2 fatal error C1083: Cannot open include file: 'sys/time.h'
来源:互联网 发布:互动投影 软件 英文 编辑:程序博客网 时间:2024/06/05 19:52
看到这篇博文不错,借用了
VS2008 winpcap配置(解决fatal error C1083: Cannot open include file: 'sys/time.h')
学习转载 2010-08-06 22:52:19 阅读235 评论2 字号:大中小 订阅
网上大多winpcap配置是关于vc6的,今天花了大半天用来配置在VS2008下的winpcap配置,我用的winpcap是4.0.2:配置过程如下:
1.安装WinPcap_4_0_2.exe,即可以抓包的驱动程序
2。下载winpcap开发包WpdPack_4_0_2.zip,里面有关开发相关的函数库以及例子
3. 打开.net平台,设置环境目录;在菜单:工具->选项;弹出的选项窗体左边点击:项目和解决方案->VC++目录;在右边:“显示以下内容的目录”标签下面的 下拉框中找到“包含文件”,然后对应到第二步下载开发包的Include目录;在同一下拉框中找到“库文件”,然后对应到第二步下载开发包的lib目录;
4. 设置编译条件;在项目属性页中:配置属性->C/C++->预处理器->预处理器定义,增加;WPCAP;HAVE_REMOTE;每 一个预定义符用";"隔开;在项目属性页中:配置属性->链接器->命令行->附加选项对应的文本框中增加:“wpcap.lib ws2_32.lib”;
5.这时运行winpcap程序会出现错误:fatal error C1083: Cannot open include file: 'sys/time.h': No such file or directory
这是由于pcap.h的预编译问题造成的,打开pcap.h,可以看到开头有这几行预编译代码:
#if defined(WIN32)
#include <pcap-stdinc.h>
#elif defined(MSDOS)
#include <sys/types.h>
#include <sys/socket.h> /* u_int, u_char etc. */
#else /* UN*X */
#include <sys/types.h>
#include <sys/time.h>
#endif /* WIN32/MSDOS/UN*X */
放在Vc 6.0下就不会错,因为系统可以识别出WIN32已经定义过了,就执行了#include <pcap-stdinc.h>,但在Vs2008下,我猜测WIN32没有被预定义过,因而直接到了
#else /* UN*X */
#include <sys/types.h>
#include <sys/time.h>
代码这里,这里是Unix的库文件,当然会出现:fatal error C1083: Cannot open include file: 'sys/time.h': No such file or directory的错误提示了.
解决办法:可以把这些预编译全部注释掉,留下 #include <pcap-stdinc.h>,这样问题就可以解决了。
1.安装WinPcap_4_0_2.exe,即可以抓包的驱动程序
2。下载winpcap开发包WpdPack_4_0_2.zip,里面有关开发相关的函数库以及例子
3. 打开.net平台,设置环境目录;在菜单:工具->选项;弹出的选项窗体左边点击:项目和解决方案->VC++目录;在右边:“显示以下内容的目录”标签下面的 下拉框中找到“包含文件”,然后对应到第二步下载开发包的Include目录;在同一下拉框中找到“库文件”,然后对应到第二步下载开发包的lib目录;
4. 设置编译条件;在项目属性页中:配置属性->C/C++->预处理器->预处理器定义,增加;WPCAP;HAVE_REMOTE;每 一个预定义符用";"隔开;在项目属性页中:配置属性->链接器->命令行->附加选项对应的文本框中增加:“wpcap.lib ws2_32.lib”;
5.这时运行winpcap程序会出现错误:fatal error C1083: Cannot open include file: 'sys/time.h': No such file or directory
这是由于pcap.h的预编译问题造成的,打开pcap.h,可以看到开头有这几行预编译代码:
#if defined(WIN32)
#include <pcap-stdinc.h>
#elif defined(MSDOS)
#include <sys/types.h>
#include <sys/socket.h> /* u_int, u_char etc. */
#else /* UN*X */
#include <sys/types.h>
#include <sys/time.h>
#endif /* WIN32/MSDOS/UN*X */
放在Vc 6.0下就不会错,因为系统可以识别出WIN32已经定义过了,就执行了#include <pcap-stdinc.h>,但在Vs2008下,我猜测WIN32没有被预定义过,因而直接到了
#else /* UN*X */
#include <sys/types.h>
#include <sys/time.h>
代码这里,这里是Unix的库文件,当然会出现:fatal error C1083: Cannot open include file: 'sys/time.h': No such file or directory的错误提示了.
解决办法:可以把这些预编译全部注释掉,留下 #include <pcap-stdinc.h>,这样问题就可以解决了。
预编译注释掉后果然没这个问题了,又出现了新的问题。。。。。。
- VS 错误2 fatal error C1083: Cannot open include file: 'sys/time.h'
- VS2008 winpcap配置(解决fatal error C1083: Cannot open include file: 'sys/time.h'...
- fatal error C1083: Cannot open include file: 'qwtplot.h':
- WINCE6错误:fatal error C1083: Cannot open include file: 'mbctype.h': No such file or
- VC6.0 fatal error C1083: Cannot open include file 错误
- fatal error C1083: Cannot open include file: 'iostream.h'错误解决方法
- fatal error C1083: Cannot open include file: 'iostream.h'错误解决方法
- 安装pymysql、mysql-python 安装错误 fatal error C1083: Cannot open include file: 'config-win.h':
- fatal error C1083: Cannot open include file
- fatal error C1083: Cannot open include file:
- C语言编译错误 fatal error C1083: Cannot open include file: 'stdio.h': No such file or directory
- mysql-python 安装错误 fatal error C1083: Cannot open include file: 'config-win.h': No such file or direc
- mysql-python 安装错误 fatal error C1083: Cannot open include file: 'config-win.h': No such file or direc
- mysql-python 安装错误 fatal error C1083: Cannot open include file: 'config-win.h': No such file or direc
- mysql-python 安装错误 fatal error C1083: Cannot open include file: 'config-win.h': No such file or direc
- Microsoft Visual Studio6.0\VC98\INCLUDE\userenv.h(15) : fatal error C1083: Cannot open include file:
- fatal error C1083: Cannot open include file: 'ProMenu.h': No such file or directory
- fatal error C1083 Cannot open include file 'iostream.h' No such file or directory 的解决方法
- hibernate中绕过ORA-00600: [qkabix] 错误
- 关于main函数的(int argc,char argv[])
- C#操作Xml
- TokyoTyrant的管理工具tcrmgr使用小记
- 在屏幕上限制输入长度
- VS 错误2 fatal error C1083: Cannot open include file: 'sys/time.h'
- vs2005下Qt编译
- J2ME之架构篇
- 新员工培训记录(2010.08.06 )
- Qt configure參數[轉]
- 英语连系动词的分类
- hdoj 3371
- 虚成员函数的实现(多态)
- SQL Server Agent 服务启动后又停止