繁体   English   中英

指定C编译器的标头位置(使用emscripten编译R代码)

[英]Specify header locations for C compiler (compiling R code with emscripten)

我对C代码的编译经验不足。 不过,我正在尝试使用emscripten将R源代码中的算法编译为JavaScript。 该功能在一个名为pf.c 这里

天真地,我刚进入src目录并尝试过:

emcc nmath/pf.c 

结果是:

In file included from nmath/pf.c:25:
nmath/nmath.h:38:10: fatal error: 'Rconfig.h' file not found
#include <Rconfig.h>
         ^
1 error generated.
ERROR    root: compiler frontend failed to generate LLVM bitcode, halting

我知道此标头在哪里:

$ find . -name "Rconfig.h"
./gnuwin32/fixed/h/Rconfig.h

我的直接问题是,如何告诉编译器此标头存在于哪里? 我想以JavaScript中的pf函数结束。 任何对此想法的见解将不胜感激。

使用-I添加到包含搜索路径。

emcc nmath/pf.c -Ignuwin32/fixed/h/

关于整体想法...听起来很奇怪,我不知道。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM