我在问题如何将字符串类型路径传递给 boost::filesystem:path 的构造函数中成功编译了程序?但是,输出结果显示的比预期的要多。
Folder status: 0
Bus error: 10
第一行是唯一的预期结果。我不明白为什么第二个来了?
我通过 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