一个lib开发包,有多个.h文件,把这个.h文件include到文件时,总提示:
error C2146: syntax error : missing ';' before identifier 'oid'
定位到这个被include 的头文件中:
typedef u_long oid;//就是这句出错。
error C2146: syntax error : missing ';' before identifier 'oid'
定位到这个被include 的头文件中:
typedef u_long oid;//就是这句出错。
#include <WinSock.h>
u_long未定义,那个开发包的头文件的include是不是有顺序的?或者直接在前面加一句typedef unsigned long u_long;
f:\bookwork\snmplib\include\snmp_api.h(656) : error C2065: 'va_alist' : undeclared identifier
f:\bookwork\snmplib\include\snmp_api.h(656) : error C2182: 'DEBUGP' : illegal use of type 'void'
出错语句:
#if HAVE_STDARG_H
void DEBUGP (const char *, ...);
#else
void DEBUGP (va_alist);
#endif
是不是因为这个开发包是C语言写成的原因?
#ifdef __cplusplus
extern "C" {
#endif
这个问题常常有,有经验就好了。
和这个没关系,他没有DEMO程序?看下INCLUDE关系
f:\bookwork\snmplib\include\snmp_api.h(656) : error C2065: 'va_alist' : undeclared identifier
f:\bookwork\snmplib\include\snmp_api.h(656) : error C2182: 'DEBUGP' : illegal use of type 'void'
出错语句:
#if HAVE_STDARG_H
void DEBUGP (const char *, ...);
#else
void DEBUGP (va_alist);
#endif
是不是因为这个开发包是C语言写成的原因?