现在的位置: 首页 > 综合 > 正文

Qt预编译头

2013年06月21日 ⁄ 综合 ⁄ 共 600字 ⁄ 字号 评论关闭

在使用winpcap库开发时,需要将HAVE_REMOTE加入
预编译头。官方文档解释如下:

  • If your program uses Win32 specific functions of WinPcap, remember to include WPCAP among the preprocessor definitions.
  • If your program uses the remote capture capabilities of WinPcap, add HAVE_REMOTE among the preprocessor definitions. Do not include remote-ext.h directly in your source files.

否则会报出  \winpcap\remote-ext.h:39: 错误:C1189: #error :  Please do not include this file directly. Just define HAVE_REMOTE and then include pcap.h

解决方法:

添加的头文件: name.h (name自拟)  这里使用stable.h

在 .pro 文件中加入红色代码:

HEADERS += \
    stable.h
PRECOMPILED_HEADER = stable.h

stable.h

#ifndef STABLE_H
#define STABLE_H

#endif // STABLE_H
#define HAVE_REMOTE

抱歉!评论已关闭.