我有以下代码:
char command[256];
sprintf(command,"addr2line %p -e xcep_app", trace[i]);
addr2lineWriter = popen(command, "r");
if (addr2lineWriter == NULL)
flag = false;
if (flag == true) //execute parsing the output only if the command ran in the first place
{
while (fgets(addr2line_output, sizeof(addr2line_output)-1, addr2lineWriter) != NULL)
{
std::string addr2line_output_(addr2line_output);
complete_backtrace_.push_back(addr2line_output_);
}
pclose(addr2lineWriter);
}
一切正常,但我总是收到以下消息:
sh: 1: Syntax error: word unexpected (expecting ")")
为什么会出现以及如何阻止它。还有,这是什么意思?我已经安装了 gnome 终端。