这段代码是在一个动态库中,我像把这个类导出,于是加上 SC_EXPORTS 宏。
class SC_EXPORTS CProtocolCheck
{
public:
CProtocolCheck(void);
~CProtocolCheck(void);
public:
static long GetProtocolVersion(const char * pBuf, long lBufLen);
static bool IsVerII_BinaryMsg(const char * pBuf, long lBufLen);
};
编译提示:
error C2470: 'CProtocolCheck' : looks like a function definition, but there is no formal parameter list; skipping apparent body

原来是因为编译器找不到 SC_EXPORTS ,居然把类当作是函数了。
只要把它定义一下或者把带有此的头文件包含就好啦。
看到这里感觉微软的编译器真是太逗了。

相关文章:

  • 2021-09-27
  • 2022-12-23
  • 2022-01-01
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-01-29
  • 2021-10-18
  • 2021-07-07
  • 2022-12-23
  • 2022-01-27
  • 2021-09-09
相关资源
相似解决方案