【问题标题】:Unable to open include file 'inttypes.h' in Borland C++ Builder无法在 Borland C++ Builder 中打开包含文件“inttypes.h”
【发布时间】:2014-03-17 14:34:27
【问题描述】:

我正在使用 Borland C++ Builder,我写了一个类,我必须使用这个头文件“inttype.h”,因为我使用的是“int64_t”。问题是我有这个错误告诉我它可以打开这个包含文件:

[C++ Error] RSA.h(3): E2209 Unable to open include file 'inttypes.h'

在 Code::Blocks 中我没有这个问题,所以我认为 C++ Builder 没有这个文件,所以我将 Code::Blocks 目录中的 'inttypes.h' 添加到我在 C++ Builder 中的项目中但仍然同样的错误。

我怎样才能克服这个问题?或者如果我不能包含这个文件,我可以使用什么长整数变量来代替 'int64_t' ?

编辑:

我的C++ Builder 版本是6

谢谢,我终于找到了一个可以说的解决方案。而不是使用"inttypes.h" 我使用"stdint.h" 但还是想知道,这个stdint.h 能做到inttypes.h 能做的所有事情吗?

【问题讨论】:

  • inttypeinttypes ?
  • inttypes ,但我在阅读您的评论后尝试了 inttype ,结果相同。 @mangusta
  • :-) 我的意思是,当您使用 #include "inttypes.h" 时,头文件可能称为 inttype.h
  • 什么版本的c++ builder?
  • 也请看一下:stackoverflow.com/questions/7597025/… 和那里链接的维基百科文章

标签: c++ c++builder


【解决方案1】:

inttypes 是一个 c99 标头。可能您的编译器不完全支持 c99。 您可以尝试#include <cinttypes>,它是 c++ 变体。或更基本的 stdint.h 或 cstdint

【讨论】:

  • @vlad_teesch 与 '#include ' 有同样的问题,但我使用 '#include' 解决了这个问题
  • 2016 年更新:Embarcadero C++Builder Seattle 10 仍然没有 cinttypes。一个真正糟糕的产品。 :(
  • C++Builder 10.1 Berlin 仍然没有它(但大多数时候 stdint.h 就足够了)。
猜你喜欢
  • 1970-01-01
  • 2012-07-27
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-07-10
相关资源
最近更新 更多