【c++】為什麼找不到stdint.h但找不到cstdint?
阿新 • • 發佈:2020-11-10
我對包含stdint.h的作品感到驚訝,但沒有包含cstdint的作品。
$ aCC sizeof.cpp
"sizeof.cpp", line 5: error #2005-D: could not open source file "cstdint"
#include <cstdint>
^
1 error detected in the compilation of "sizeof.cpp".
$ aCC --version
aCC: HP C/aC++ B3910B A.06.12 [Nov 03 2006]
與g++相同:
$ g++ --version
g++ (GCC) 4.2.3
請問為什麼?並且,除了更新編譯器之外,是否有任何方法可以解決此問題?
謝謝。
解決辦法
您的編譯器支援沒有<cstdint>的舊C++標準(因為C90沒有<stdint.h>)。 <cstdint>是C++ 11的新功能。
