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

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
You need to include stdint.h
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
Topic archived. No new replies allowed.