【问题标题】:How to install nan.h on cygwin for g++?如何在 cygwin 上为 g++ 安装 nan.h?
【发布时间】:2018-02-12 22:34:35
【问题描述】:

我无法在 cygwin 上构建这个简单的程序:

#include <nan.h>
int main(){}

我收到此错误消息:

$ g++ a.cpp
a.cpp:1:17: fatal error: nan.h: No such file or directory
compilation terminated.

是否可以在 cygwin 上安装一些东西来获得正确的 nan.h?

【问题讨论】:

  • nan.h 是什么,你从哪里得到的?
  • @Ron,这没有帮助,同样的信息。
  • @StepanYakovenko 在这种情况下,您需要提供头文件的路径。
  • nan.h 是 doubledouble 包的一部分
  • 如果你正在使用 gyp,你需要 require(v8)。如果您正在使用 cmake,则需要 require() 众多帮助模块之一(google cmake v8)

标签: c++ g++ cygwin


【解决方案1】:

nan.h 是旧 gcc 的过时包含。在 Cygwin NAN 上定义为 math.h

你不能用2008年写的软件
https://boutell.com/fracster-src/doubledouble/doubledouble.html
对于这样的具体问题,只是希望它能够开箱即用。

【讨论】:

    【解决方案2】:

    您需要确定 nan.h 的位置,然后将此路径添加到包含中。

    How to make g++ search for header files in a specific directory?

    【讨论】:

    • 我的 /cygwin 文件夹中缺少 nan.h。很可能它已被弃用,而且 doubledouble 对于现代 C++ 编译器来说太旧了,无法开箱即用。
    • @StepanYakovenko 我相信 long double 内在类型应该已经很好地为您服务了。
    • 是的,但我的最终目标是将 doubledobule 移植到 Rust 以模拟最近已弃用的 f128。
    猜你喜欢
    • 1970-01-01
    • 2015-03-26
    • 2011-04-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多