http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54451
--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-09-09 17:19:44 UTC --- (In reply to comment #4) > Maybe it would be nice to use #error in header file to inform the user that > this feature is not supported for target system (nicer than to get linker > error > later) You won't get a linker error, if the macro is not defined then the types in <random> are not declared, so code using them won't compile. Using #error would prevent #include <random> which I don't think is a good idea. There's no harm including the header as long as you don't try to use types which require a working <stdint.h> The fix is to simply make random.cc check the macro. This is what we already do in future.cc and thread.cc and mutex.cc and other files too.