I am trying to call system from a cpp program with the following command
system("ln -s -t \"targetDir[0]\" \"baseDir[0]\"");
Both targetDir and baseDir are QStringList. The program compiles and runs but when I execute the command i get the error ln : targetDir[0] is an invalid command. When I test by hard coding the values instead of using variables it works just fine. I can only conclude it is not escaping the string to put the value of the variables int the argument passed to ln. For the life of me I can't figure out why not.
Any Ideas?