无法在我的C++代码中调用 gnome-terminal 命令

Unable to call gnome-terminal command in my C++ code

本文关键字:调用 gnome-terminal 命令 代码 C++ 我的      更新时间:2023-10-16
char *mycmd = "gnome-terminal --profile 'me' -e '/usr/bin/programA --file/usr/bin/config/myconfig.ini --name="programA" --loggingLevel=1'";
popen(mycmd, "r");

第一行错误:错误:expected ';' before 'Node'

我知道这是因为"表示--name

有没有办法让这个命令工作?

转义双引号:

char *mycmd = "gnome-terminal --profile 'me' -e '/usr/bin/programA --file/usr/bin/config/myconfig.ini --name="programA" --loggingLevel=1'";