Compilation fails with "error: 'uint32_t' does not name a type"

Mar 8, 2016 at 9:46am
Hi,

I have a huge program, which uses the boost library as well as the standard c++ libraries, while I compile I get the error, "error: 'uint32_t' does not name a type".

This seems to happen due to the conflict between the boost/cdtdint.hpp and stdint.h both of which contain the definitions for uint32_t. Also how do I explicitly define the compiler should consider c++11 standards.

This works on RHEL but fails on SLES 12.

Thanks,
Sanjay
Last edited on Mar 8, 2016 at 10:15am
Mar 8, 2016 at 10:43am
You need to include stdint.h
Mar 8, 2016 at 11:46am
Include the C++ header <cstdint> and explicitly write out the namespace, e.g. std::uint32_t. That should define the type correctly and get rid of any ambiguities between boost and std.

how do I explicitly define the compiler should consider c++11 standards.

If you're using GCC the compiler flag is -std=c++11
Last edited on Mar 8, 2016 at 11:47am
Topic archived. No new replies allowed.