title: g++ errno_t and fopen_s error in Debian 8.1 Jessie
body: <p>I have written some code in Windows 8.1, Visual Studio 2013 Express. Now, I am trying to transfer and run this code on my Beagle Bone Black which is running Debian 8.1 Jessie. This is my first time using Linux so I am having some problems.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;errno.h&gt;
  #include &lt;stdio.h&gt;
  
  using namespace std;
  
  int main()
  {
      FILE *cfPtr;
      errno_t err;
  
      if ((err = fopen_s(&amp;cfPtr, "objects.txt", "a +")) != 0) // Check if we can reach the file
          cout &lt;&lt; "The file 'objects.txt' was not opened.\n";
      else
          fclose(cfPtr);
  
      return 0;
  }
  </code></pre>
  
  <p>I compile this code with:</p>
  
  <blockquote>
    <p>g++ source.cpp -o source</p>
  </blockquote>
  
  <p>But it gives me some ... was not declared in this scope kind of errors.</p>
  
  <pre><code>source.cpp: In function ‘int main()’:
  source.cpp:10:4: error: ‘errno_t’ was not declared in this scope
  source.cpp:10:12: error: expected ‘;’ before ‘err’
  source.cpp:12:8: error: ‘err’ was not declared in this scope
  source.cpp:12:50: error: ‘fopen_s’ was not declared in this scope
  </code></pre>
  
  <p>I see, *_s functions for Windows, so how can I fix this and errno_t problems?</p>
  
  <p>Thank you.</p>