If I understand right, you want to pass a parameter via define on commandline and use it as string inside the program.
Is this correct ?
google leads me to this post: http://bytes.com/groups/cpp/443326-portable-way-pass-string-c-macro (http://bytes.com/groups/cpp/443326-portable-way-pass-string-c-macro)
This is a sample code that outputs a string passed to gcc with -DTEST="The String".
#define ToString1_(x) #x
#define ToString_(x) ToString1_(x)
#define MyDefinedString ToString_(TEST)
#include <iostream>
using namespace std;
int main()
{
cout << MyDefinedString << endl;
return 0;
}
The "Build options -> Compiler settings -> #defines"-tab contains:
The output (started from inside C::B) is:
The String
Process returned 0 (0x0) execution time : 0.000 s
Press ENTER to continue.
It works on windows and linux without scripting or any quotation-incompatibilities .