title: error C3861: '_tcsdup': identifier not found
body: <p>This is my first time and I'd like to make a parallel process using the windows <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms682425%28v=vs.85%29.aspx" rel="nofollow noreferrer">CreateProcess</a> function. Based on the example at MSDN I created a <a href="https://stackoverflow.com/questions/321413/lpcstr-lpctstr-and-lptstr"><code>LPTSTR</code> "(non-const) TCHAR string"</a> <a href="http://en.wikipedia.org/wiki/Command-line_interface" rel="nofollow noreferrer">command line</a> argument like this</p>
  
  <pre><code>LPTSTR szCmdline[] = _tcsdup(TEXT("\C:\\MyProgram_linux_1.1\\MyProgram.exe") );
  </code></pre>
  
  <p>The LPTSTR and other <a href="http://www.codeproject.com/Articles/76252/What-are-TCHAR-WCHAR-LPSTR-LPWSTR-LPCTSTR-etc" rel="nofollow noreferrer">char and string types are discussed here</a></p>
  
  <p>The command line argument is passed to <code>CreateProcess</code> like this</p>
  
  <pre><code>if (!CreateProcess(NULL, szCmdline, /*...*/) ) cout &lt;&lt; "ERROR: cannot start CreateProcess" &lt;&lt; endl;
  </code></pre>
  
  <p>And these headers are present</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;windows.h&gt;
  #include &lt;strsafe.h&gt;
  #include &lt;direct.h&gt;
  </code></pre>
  
  <p>On compile this is the error:</p>
  
  <pre><code>error C3861: '_tcsdup': identifier not found
  </code></pre>
  
  <p>A search for this error found <a href="http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/db2b883d-6f95-4ca8-8219-648db3b07b18" rel="nofollow noreferrer">the same error but the solution was specific to using  a .NET framework</a> rather than explaining the <code>error C3861: '_tcsdup'</code></p>
  
  <p>Not sure if it related but there is also an <code>error C2059: syntax error : ')'</code> on the <code>if (!CreateProcess(NULL, szCmdline, /*...*/) ) cout &lt;&lt; "ERROR: cannot start CreateProcess" &lt;&lt; endl;</code></p>
  
  <p>How is this error fixed? And, what is going on with this?</p>
  
  <p>Also, I am using the <a href="https://stackoverflow.com/questions/985281/what-is-the-closest-thing-windows-has-to-fork"><code>CreateProcess</code> as a learning step towards learning the Linux <code>fork()</code></a> function - the Visual Studio interface is easier for me to use and once this is debugged and works, I will change to the g++ interface and change to <code>fork()</code> and debug from there - so a solution that leads to <code>fork()</code>, if possible, is the most beneficial.</p>