简体   繁体   中英

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

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' expected ';' before 'Node'

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

Is there anyway to get this command to work?

逃避双引号:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM