I successfully compile the program at the Question How to pass a string type path to boost::filesystem:path's constructor? However, the output result shows more than the expected one.
Folder status: 0
Bus error: 10
The first line is the only expected result. I do not understand why the second one comes?
I get the following debug information by gdb:
(gdb) run
Starting program: /Users/ZL/Desktop/mtfsg
Reading symbols for shared libraries ++++............................. done
Folder status: 0
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00007fff5fc005a0
0x00007fff9046aab7 in std::basic_string<char, std::char_traits<char>,
std::allocator<char>>::~basic_string ()
(gdb) bt
#0 0x00007fff9046aab7 in std::basic_string<char, std::char_traits<char>,
std::allocator<char> >::~basic_string ()
#1 0x00000001000018dd in main () at m.cpp:12
gbd. When it crashes, typewhere. Then you useupanddownto navigate the stack frames andprintto see the values of things.