c++ - 包含现有标题的致命错误
问题描述
当我尝试使用 Fastor-Library ( https://github.com/romeric/Fastor ) 并包含该库时,我收到错误消息,即 repo 中的文件夹不存在。这是代表我的错误,还是我应该向 Fastor 的作者提出问题?
代码:
#include "Fastor/Fastor.h"
int main(){
Fastor::Tensor<double,2> A;
return 0;
}
文件夹结构:
total 8
drwxr-xr-x 15 name name 4096 Feb 13 13:19 Fastor
-rw-r--r-- 1 name name 82 Feb 13 13:20 main.cpp
为什么我会收到以下错误?
g++ -std=c++14 -O3 -mavx -DNDEBUG main.cpp -o main
In file included from Fastor/simd_vector/SIMDVector.h:4:0,
from Fastor/Fastor.h:6,
from main.cpp:1:
Fastor/simd_vector/simd_vector_base.h:4:10: fatal error: commons/commons.h: No such file or directory
#include "commons/commons.h"
^~~~~~~~~~~~~~~~~~~
compilation terminated.
你能重现错误,还是我做错了什么?
解决方案
你的编译器命令应该是:
g++ -std=c++14 -O3 -mavx -DNDEBUG main.cpp -o main -I Fastor
你应该只包括"Fastor.h"
而不是"Fastor/Fastor.h"
.
推荐阅读
- module - omnet 如何初始化模块和模型?
- r - How to plot bar chart grouped by secondary variable in R?
- laravel - 将 Laravel 5.4 Web App 添加到移动设备主屏幕
- javascript - 更改或覆盖 JavaScript 函数
- mongodb - 如何使用多个索引将数据导入mongodb
- javascript - 在 onKeyboardShow 函数内部更改值时,Ionic 3 输入集未触发
- shell - 切割的管道输出
- python - Python:努力掩盖数据集的一部分
- javascript - 仅在一个组件中调用方法
- sql - 使用多个左连接将行连接成一个