Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22006

Segmentation fault error for `create_directories`

$
0
0

I compile the following code with gcc-9 in QtCreator in Ubuntu:

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

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

But a run-time error with message Segmentation fault (core dumped) closes the program in line:

bool any_new_folders = create_directories("aaa");

however the folder aaa is created beside the exe file. The exe file is created in a folder inside home folder.

Why does it happen and how can I solve the problem?


Step by step executions shows that the problem happens in a function named _M_split_cmpts in fs_path.h (line 184). fs_path.h is a standard header file.


Viewing all articles
Browse latest Browse all 22006

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>