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

Error on 1st line: error: expected ';' before 'Node'

I know this is because of the "" for --name

Is there anyway to get this command to work?

有帮助吗?

解决方案

Escape the double quotes :

char *mycmd = "gnome-terminal --profile 'me' -e '/usr/bin/programA --file/usr/bin/config/myconfig.ini --name=\"programA\" --loggingLevel=1'";
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top