2014-08-27 79 views
0

我试图编译一些旧的C++项目,跑进一个错误,我想不通这是怎么回事。功能的typedef指针错误

的错误是在这一行(18):

typedef uint16_t (*vfunc)(); 

GCC输出:

vflow.h:18: warning: ISO C++ forbids declaration of 'uint16_t' with no type 
vflow.h:18: error: typedef 'uint16_t' is initialized (use decltype instead) 
vflow.h:18: error: 'vfunc' was not declared in this scope 

我的C++比我的英语更差;请帮忙。 =)

+3

您有加入''或''事先让你有'uint16_t'界定?看起来你还没有定义'uint16_t'。 – 2014-08-27 17:48:30

+0

是的!就是这样,谢谢。发布它作为答案,我会接受它。 – rMX 2014-08-27 17:49:32

回答

7

转移我的评论一个答案:

你既包括事先所以你uint16_t定义<stdint.h><cstdint>?看起来您还没有定义uint16_t

从反应来看,这是你的问题。