【问题标题】:#include <ruby.h> It's not working#include <ruby.h> 它不起作用
【发布时间】:2012-09-03 19:33:34
【问题描述】:

我已经多次尝试通过谷歌、本网站和其他一些网站在互联网上找到这些信息;我似乎找不到一个好的教程和/或答案。

我将如何在 Visual C++ 2010 中使用 Ruby C API?我已将 Ruby 包含文件夹添加到我的项目的包含路径中,并且我还添加了 Ruby devkit 包含文件夹。但是当我#include &lt;ruby.h&gt; 时仍然找不到inttypes.h,并且在添加devkit 路径之前它找不到其他各种头文件。

我做错了什么?

【问题讨论】:

  • 标头 inttypes.h 不随 Visual Studio 提供。如果您必须在 Visual Studio 中包含 C99 标头,请怀疑它的存在:)。
  • 从技术上讲,该主题仍然没有向我解释如何在 Visual c++ 中使用 ruby​​ 的 c api。似乎仅仅添加#include &lt;ruby.h&gt; 是不够的。

标签: c ruby visual-c++ include ruby-c-extension


【解决方案1】:

Visual Studio 不附带 inttypes.h,因为它没有适当的 C99 支持。

您需要从第三方来源获取此标头,例如http://code.google.com/p/msinttypes/

【讨论】:

  • 似乎“没有这样的文件或目录”@inttypes.h 在我将您留给我的文件包含到我的项目中之后并没有消失..另外,现在我得到了c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdint.h(33): error C2371: 'int_fast8_t' : redefinition; different basic types 1&gt; c:\users\owner\documents\visual studio 2010\projects\fyxtools\fyxtools\stdint.h(104) : see declaration of 'int_fast8_t'
猜你喜欢
  • 1970-01-01
  • 2023-04-06
  • 2015-02-20
  • 2016-02-24
  • 1970-01-01
  • 1970-01-01
  • 2015-02-13
  • 1970-01-01
相关资源
最近更新 更多