error: 'String' does not name a type In function

The new String (version 0.9 I think) IS the old WString (or TextString).... You might have issues in using both of them. There is no need for this.