create_directories的分段错误错误

时间:2019-12-07 06:16:06

标签: c++ ubuntu gcc c++17

我在Ubuntu的QtCreator中使用gcc-9编译以下代码:

#include <filesystem>
using namespace std::filesystem;

int main()
{
    bool any_new_folders = create_directories("aaa");
    printf("success");
}

但是消息为Segmentation fault (core dumped)的运行时错误关闭了以下程序:

bool any_new_folders = create_directories("aaa");

但是在exe文件旁边创建了文件夹aaa。 exe文件是在主文件夹内的文件夹中创建的。

为什么会发生,我该如何解决该问题?


逐步执行表明,问题发生在_M_split_cmpts中名为fs_path.h的函数中(第184行)。 fs_path.h是标准的头文件。

0 个答案:

没有答案