title: Linking iostream and other libraries for Clang++ on the Command Prompt
body: <p>When doing what I mentioned in the thread title, I get the following error message from Clang++: </p>
  
  <blockquote>
    <p>C:\Users\Osman\programming\visual studio 2015\Projects\programming_principles_and_practice_using_c++\chars_with_int_values\chars_with_int_values>clang++ -std=c++14 -Wall -pedantic chars_with_int_values.cpp -lstd_lib_facilities -li -o chars_with_int_values
    In file included from chars_with_int_values.cpp:10:
    ./std_lib_facilities.h:28:9: fatal error: 'iostream' file not found
       #include
          ^
       1 error generated.</p>
  </blockquote>
  
  <p>The file std_lib_facilities.h is the header file Stroustrup has the readers of his book Programming: Principles and Practice Using C++ use.  Do I have to link in iostream from that file (though I'd also have to link of the files mentioned in the header as well, which includes a whole bunch of headers like iomanip, sstream, string, vector, etc..</p>
  
  <p>The source code:</p>
  
  <pre><code>// chars_with_int_values.cpp : Defines the entry point for the console application.
  // Osman Zakir
  // 10 / 7 / 2016
  // Programming: Principles and Practice Using C++ 2nd Edition
  // Chapter 3 Section 4.4 "Try this":
  // Write a loop that prints out characters 'a' through 'z' with their integer values
  // seperated by tabs
  // Later modified to also print out a table showing capital letters and their integer values
  
  #include "std_lib_facilities.h"
  
  int main()
  {
      for (char c = 'a'; c &lt;= 'z'; ++c)
      {
          cout &lt;&lt; c &lt;&lt; "\t" &lt;&lt; int(c) &lt;&lt; "\n";
      }
      cout &lt;&lt; "\n";
      for (char c1 = 'A'; c1 &lt;= 'Z'; ++c1)
      {
          cout &lt;&lt; c1 &lt;&lt; "\t" &lt;&lt; int(c1) &lt;&lt; "\n";
      }
      keep_window_open();
      return 0;
  }
  </code></pre>
  
  <p>The header file std_lib_facilities.h is used with the book on C++ written by Stroustrup that I mentioned before.  It includes the headers iostream, iomanip, fstream, sstream, cmath, scstdlib, string, list, forward_list, vector, unordered_map, algorithm, array, regex, random and stdexcept, and it also defines some functions such as keep_window_open() (which acts as a workaround for the Windows console closing on its own immediately after showing the program's output), and it has the "using namespace std" directive up top which Stroustrup says in the book itself is something that should be done at the programmer's own risk.  The header is to be used only for the few chapters or so, though, and the book probably teaches you to get used to programming without it later as well (I haven't gotten that far yet, so I'm not sure).</p>