This documentation is archived and is not being maintained.

Compiler Error C3921

Error Message

Use of S-prefixed strings requires /clr:oldSyntax command line option

In Visual C++ 2005, you no longer need to explicitly specify that a string is a CLR string.

Example

The following sample generates C3921.

// C3921.cpp
// compile with: /clr
using namespace System;

int main() {
   String ^ s = S"CLR string literal";   // C3921

   // try the following line instead
   String ^ s2 = "CLR string literal";
}
Show: