title: Rcpp: error occured building shared library
body: <p>I have a cpp code in a file named PSM.cpp as given below, </p>
  
  <pre><code>#include &lt;Rcpp.h&gt;
  
  // [[Rcpp::export]]
  std::vector&lt;std::string&gt; useInitLists() {
      std::vector&lt;std::string&gt; vec = {"larry", "curly", "moe"};
      return vec;
  }
  </code></pre>
  
  <p>When I source the following code, I get following error.</p>
  
  <pre><code>&gt; Rcpp::sourceCpp("PSM.cpp")
  g++ -m64 -I"C:/PROGRA~1/R/R-30~1.2/include" -DNDEBUG     -I"C:/Users/30708/Documents/R/win-library/3.0/Rcpp/include"  -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -mtune=core2 -c PSM.cpp -o PSM.o
  PSM.cpp: In function 'std::vector&lt;std::basic_string&lt;char&gt; &gt; useInitLists()':
  PSM.cpp:5:60: error: in C++98 'vec' must be initialized by constructor, not by '{...}'
  PSM.cpp:5:60: error: could not convert '{"larry", "curly", "moe"}' from '&lt;brace-enclosed initializer list&gt;' to 'std::vector&lt;std::basic_string&lt;char&gt; &gt;'
  make: *** [PSM.o] Error 1
  Error in Rcpp::sourceCpp("PSM.cpp") : 
    Error 1 occurred building shared library.
  </code></pre>
  
  <p>Can someone please suggest what the error means and how to resolve the same? Thanks. </p>