c - 使用 gcc 编译/转换,matrix.h : No such file or directory

标签 c r linux ubuntu gcc

我正在尝试使用 gcc 将一些 .c 文件转换为 R 文件。 我所说的文件是位于以下位置的 circulant.c 和 circulant.h 文件:

http://www.columbia.edu/~ad3217/fbm.html

作者还提供了如何使用 gcc 进行操作的简短说明。 到目前为止我所做的事情:

  1. 通过 Win10 Linux 子系统安装了 Ubuntu
  2. 安装构建要点
  3. 已安装 gcc
  4. 下载了所有meschach文件

    http://www.netlib.org/c/meschach/

  5. 将meschach文件夹和circulant.x文件放到一个文件夹中,运行命令

    $gcc -I meschach/-c circulant.c

给出错误:

In file included from circulant.c:25:0:
circulant.h:11:20: fatal error: matrix.h: No such file or directory
compilation terminated.

我希望对 gcc 有更多了解的人可以帮助我并指出解决方案。

最佳答案

您没有使用正确的头文件。

您需要首先解决一些依赖性问题。来自 circulant.c 的评论标题 block :

/*  This program simulates fractional Gaussian noise or fractional          */
/*  Brownian motion using the Wood and Chan algorithm.                      */
/*  The C-packages Ranlib and Meschach are used, both available             */
/*  via Netlib (http://www.netlib.org).                                     */

在我看来,缺少的 matrix.hmatrix2.h 文件来自 meschach图书馆。

您不能只将 .shar 文件复制到目录中。

您需要阅读 README文件并按照安装说明进行操作。所以我建议安装 ranlibmeschach首先是依赖关系。

关于c - 使用 gcc 编译/转换,matrix.h : No such file or directory,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49887196/

相关文章:

r - 仅在 R 中的 ANOVA 循环上打印显着结果

c - 为什么进程要处理阻塞的信号?

c++ - 当磁盘快满时,使用 C++ 流缓冲区在 Linux 中复制文件没有异常?

c - 为什么 memcpy 需要一个 const void 指针?

c - SDL2 和 Xcode 的渲染器问题

c++ - 我的程序被 avast 防病毒软件阻止

通过C程序进行Android串口通信

r - 如何将 "roll up"值写入后续记录?

r - 从 CSV 文件 : why is the DB file 0KB and contains no tables? 在 R 中创建 SQLite 数据库

linux - 解析参数的代码错误