Reputation: 30915
I have :
QString ver ="";
QString ver += "-svn-"SVN_REVISION
which yields an error pointing me to ver:
error: missing terminating " character
ver += "-svn-"SVN_REVISION;
SVN_REVISION is defined as 1.
How can I concatenate them to be a valid string?
Upvotes: 0
Views: 417
Reputation: 16737
You can use the preprocessor's stringify support as has been mentioned in the comments. Here's an example:
#define BASIC_STR(x) #x
#define STR(x) BASIC_STR(x)
QString ver ="";
QString ver += "-svn-" STR(SVN_VERSION);
Upvotes: 2