2014-08-27 60 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

從反應來看,這是你的問題。