title: Done building project "Error.vcxproj" -- FAILED
body: <p>I am trying to copy content from source file to target file  using fread and fwrite in visual studio 2019 but I am encountering the following error: 1&gt;Done building project &quot;project.vcxproj&quot; -- FAILED.      Here is my code:</p>
  <pre><code>#include &lt;iostream&gt;
  #define _CRT_SECURE_NO_WARNINGS
  #include&lt;stdio.h&gt;
  using namespace std;
  int my_pc(const char* src_file, const char* dest_file) {
      FILE *in_file, *out_file;
      in_file = fopen(src_file, &quot;rb&quot;);
      if (in_file == NULL) {
          return 1;
      }
      out_file = fopen(dest_file, &quot;wb&quot;);
      if (out_file == NULL) {
          return 2;   
      }
      char rec[256];
      size_t bytes_in, bytes_out;
      while ((bytes_in=fread(rec, 1, 256, in_file)) &gt; 0) {
          bytes_out = fwrite(rec, 1, bytes_in, out_file);
          if(bytes_in!=bytes_out)
          {
              return 3;
          }
      }
      fclose(in_file);
      fclose(out_file);
  
      return 0;
  
  }
  int main() {
      int result;
      if ( result = my_pc(&quot;c:\\temp\\1.txt&quot;, &quot;\\temp\\2.txt&quot;) != 0) {
          switch (result) {
          case 1:
              cout &lt;&lt; &quot;error from opening source file\n&quot; &lt;&lt; endl;
              break;
          case 2:
              cout &lt;&lt; &quot;error from opening target file \n &quot; &lt;&lt; endl;
              break;
          case 3:
              cout &lt;&lt; &quot;error from copy file \n&quot; &lt;&lt; endl;
              break;
          default:
              cout &lt;&lt; &quot;unknown error occured\n&quot; &lt;&lt; endl;
              break;
          }
      }
      cout &lt;&lt; &quot;ok!&quot; &lt;&lt; endl;
  }
  </code></pre>
  <p>Please help me point out where my problem comes from. I am new in visual studio. Thanks in advance.
  (PS: this is my output tabe</p>
  <pre><code>1&gt;------ Build started: Project: Error, Configuration: Debug Win32 ------
  1&gt;Source.cpp
  1&gt;C:\Users\beiji\source\repos\Error\Error\Source.cpp(7,12): error C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
  1&gt;C:\Users\beiji\source\repos\Error\Error\Source.cpp(11,13): error C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
  1&gt;Done building project &quot;Error.vcxproj&quot; -- FAILED.
  ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
  )
  </code></pre>