title: I'm trying to run C++ code that uses the Boost library
body: <p>I would prefer not to download anything, but if I must, I can do so. I am just trying to run a simple multi-threaded program using the Boost library on many of the online compilers, but none of them even recognize </p>
  
  <pre><code>#include &lt;boost/thread.hpp&gt;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>using namespace boost::this_thread;
  </code></pre>
  
  <p>The code itself is taken from this link:
  <a href="https://www.quantnet.com/threads/c-multithreading-in-boost.10028/" rel="nofollow">https://www.quantnet.com/threads/c-multithreading-in-boost.10028/</a></p>
  
  <p>I have done my googling and tried out a lot of online compilers but none of them seem willing to recognize Boost or its associated libraries.</p>
  
  <p>This is the code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;boost/thread.hpp&gt;
  
  using namespace std;
  using namespace boost;
  using namespace boost::this_thread;
  
  // Global function called by thread
  void GlobalFunction()
  {
     for (int i=0; i&lt;10; ++i) {
         cout&lt;&lt; i &lt;&lt; "Do something in parallel with main method." &lt;&lt; endl;
         boost::this_thread::yield(); // 'yield' discussed in section 18.6
     }
  }
  
  int main()
  {
      boost::thread t(&amp;GlobalFunction);
      for (int i=0; i&lt;10; i++) {
          cout &lt;&lt; i &lt;&lt;"Do something in main method."&lt;&lt;endl;
      }
      return 0;
  }
  </code></pre>