如何在cygwin上为g ++安装nan.h?

问题描述:

我不能建立在cygwin的这个简单的程序:如何在cygwin上为g ++安装nan.h?

#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?

+0

什么是'nan.h',你从哪里得到它? – user0042

+0

@Ron,这没有帮助,同样的信息。 –

+0

@StepanYakovenko在这种情况下,您需要提供头文件的路径。 – Ron

nan.h是一个过时包括旧的gcc。在Cygwin NAN上math.h

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

您需要确定nan.h的位置,并将此路径添加到includes。

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

+0

nan.h在my/cygwin文件夹中丢失。大多数情况下,它不推荐使用,并且现成的C++编译器在盒子外建立的时间太长了。 –

+0

@StepanYakovenko我相信'long double'内在类型应该已经很好地为你服务了。 – user0042

+0

是的,但是我最终的目标是将双骰子移植到Rust,以便模仿最近弃用的f128。 –