'uint32_t' does not name a type

后端 未结 9 1763
旧时难觅i
旧时难觅i 2021-01-30 12:13

I\'m trying to compile a C++ software package that was written in 2007 and I\'m getting this error:

error: ‘uint32_t’ does not name a type

This is h

9条回答
  •  死守一世寂寞
    2021-01-30 12:45

    You need to #include , but that may not always work.

    The problem is that some compiler often automatically export names defined in various headers or provided types before such standards were in place.

    Now, I said "may not always work." That's because the cstdint header is part of the C++11 standard and is not always available on current C++ compilers (but often is). The stdint.h header is the C equivalent and is part of C99.

    For best portability, I'd recommend using Boost's boost/cstdint.hpp header, if you're willing to use boost. Otherwise, you'll probably be able to get away with #include'ing .

提交回复
热议问题