致命错误:文件系统:没有这样的文件或目录 [英] fatal error: filesystem: No such file or directory

查看:1204
本文介绍了致命错误:文件系统:没有这样的文件或目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用CentOs 7.1,gcc版本6.1.0(GCC)
我收到此错误:

Using, CentOs 7.1, gcc version 6.1.0 (GCC) I receive this error:

fatal error: filesystem: No such file or directory

在此行

#include <filesystem>

使用

g++ main.cpp -o main -std=c++17

其中

推荐答案

似乎您必须包含< filesystem> 像这样:

It seems you have to include <filesystem> like this:

#include <experimental/filesystem>

别忘了添加 -lstdc ++ fs 作为GCC标志!

Don't forget to add -lstdc++fs as a GCC flag!

这里是证据:
花木

如果这不起作用,则可能意味着您没有文件系统

If that doesn't work, then that probably means that you don't have filesystem in your configuration.

另外,如@MartinR。指出,在GCC 8+中不再需要 实验性

Also, as @MartinR. pointed out, the experimental is no longer needed in GCC 8+.

这篇关于致命错误:文件系统:没有这样的文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆