title: Issues with macos GCC toolchain compiling simple hello world
body: <p>I am having some issues with my gcc configuration on macOS 10.14.6.</p>
  
  <p>hello.cpp:</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  int main(){
      cout &lt;&lt; "Hello World.";
  }
  </code></pre>
  
  <p>command:</p>
  
  <pre><code>$ gcc -o hello hello.cpp
  </code></pre>
  
  <p>Response:</p>
  
  <pre><code>Undefined symbols for architecture x86_64:
    "std::__1::locale::use_facet(std::__1::locale::id&amp;) const", referenced from:
        std::__1::ctype&lt;char&gt; const&amp; std::__1::use_facet&lt;std::__1::ctype&lt;char&gt; &gt;(std::__1::locale const&amp;) in hello-1b0e0e.o
    "std::__1::ios_base::getloc() const", referenced from:
        std::__1::basic_ios&lt;char, std::__1::char_traits&lt;char&gt; &gt;::widen(char) const in hello-1b0e0e.o
    "std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt;::__init(unsigned long, char)", referenced from:
        std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt;::basic_string(unsigned long, char) in hello-1b0e0e.o
    "std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt;::~basic_string()", referenced from:
        std::__1::ostreambuf_iterator&lt;char, std::__1::char_traits&lt;char&gt; &gt; std::__1::__pad_and_output&lt;char, std::__1::char_traits&lt;char&gt; &gt;(std::__1::ostreambuf_iterator&lt;char, std::__1::char_traits&lt;char&gt; &gt;, char const*, char const*, char const*, std::__1::ios_base&amp;, char) in hello-1b0e0e.o
    "std::__1::basic_ostream&lt;char, std::__1::char_traits&lt;char&gt; &gt;::sentry::sentry(std::__1::basic_ostream&lt;char, std::__1::char_traits&lt;char&gt; &gt;&amp;)", referenced from:
        std::__1::basic_ostream&lt;char, std::__1::char_traits&lt;char&gt; &gt;&amp; std::__1::__put_character_sequence&lt;char, std::__1::char_traits&lt;char&gt; &gt;(std::__1::basic_ostream&lt;char, std::__1::char_traits&lt;char&gt; &gt;&amp;, char const*, unsigned long) in hello-1b0e0e.o
    "std::__1::basic_ostream&lt;char, std::__1::char_traits&lt;char&gt; &gt;::sentry::~sentry()", referenced from:
        std::__1::basic_ostream&lt;char, std::__1::char_traits&lt;char&gt; &gt;&amp; std::__1::__put_character_sequence&lt;char, std::__1::char_traits&lt;char&gt; &gt;(std::__1::basic_ostream&lt;char, std::__1::char_traits&lt;char&gt; &gt;&amp;, char const*, unsigned long) in hello-1b0e0e.o
    "std::__1::cout", referenced from:
        _main in hello-1b0e0e.o
    "std::__1::ctype&lt;char&gt;::id", referenced from:
        std::__1::ctype&lt;char&gt; const&amp; std::__1::use_facet&lt;std::__1::ctype&lt;char&gt; &gt;(std::__1::locale const&amp;) in hello-1b0e0e.o
    "std::__1::locale::~locale()", referenced from:
        std::__1::basic_ios&lt;char, std::__1::char_traits&lt;char&gt; &gt;::widen(char) const in hello-1b0e0e.o
    "std::__1::ios_base::__set_badbit_and_consider_rethrow()", referenced from:
        std::__1::basic_ostream&lt;char, std::__1::char_traits&lt;char&gt; &gt;&amp; std::__1::__put_character_sequence&lt;char, std::__1::char_traits&lt;char&gt; &gt;(std::__1::basic_ostream&lt;char, std::__1::char_traits&lt;char&gt; &gt;&amp;, char const*, unsigned long) in hello-1b0e0e.o
    "std::__1::ios_base::clear(unsigned int)", referenced from:
        std::__1::ios_base::setstate(unsigned int) in hello-1b0e0e.o
    "std::terminate()", referenced from:
        ___clang_call_terminate in hello-1b0e0e.o
    "___cxa_begin_catch", referenced from:
        std::__1::basic_ostream&lt;char, std::__1::char_traits&lt;char&gt; &gt;&amp; std::__1::__put_character_sequence&lt;char, std::__1::char_traits&lt;char&gt; &gt;(std::__1::basic_ostream&lt;char, std::__1::char_traits&lt;char&gt; &gt;&amp;, char const*, unsigned long) in hello-1b0e0e.o
        ___clang_call_terminate in hello-1b0e0e.o
    "___cxa_call_unexpected", referenced from:
        std::__1::ostreambuf_iterator&lt;char, std::__1::char_traits&lt;char&gt; &gt;::ostreambuf_iterator(std::__1::basic_ostream&lt;char, std::__1::char_traits&lt;char&gt; &gt;&amp;) in hello-1b0e0e.o
    "___cxa_end_catch", referenced from:
        std::__1::basic_ostream&lt;char, std::__1::char_traits&lt;char&gt; &gt;&amp; std::__1::__put_character_sequence&lt;char, std::__1::char_traits&lt;char&gt; &gt;(std::__1::basic_ostream&lt;char, std::__1::char_traits&lt;char&gt; &gt;&amp;, char const*, unsigned long) in hello-1b0e0e.o
    "___gxx_personality_v0", referenced from:
        std::__1::basic_ostream&lt;char, std::__1::char_traits&lt;char&gt; &gt;&amp; std::__1::__put_character_sequence&lt;char, std::__1::char_traits&lt;char&gt; &gt;(std::__1::basic_ostream&lt;char, std::__1::char_traits&lt;char&gt; &gt;&amp;, char const*, unsigned long) in hello-1b0e0e.o
        std::__1::ostreambuf_iterator&lt;char, std::__1::char_traits&lt;char&gt; &gt; std::__1::__pad_and_output&lt;char, std::__1::char_traits&lt;char&gt; &gt;(std::__1::ostreambuf_iterator&lt;char, std::__1::char_traits&lt;char&gt; &gt;, char const*, char const*, char const*, std::__1::ios_base&amp;, char) in hello-1b0e0e.o
        std::__1::ostreambuf_iterator&lt;char, std::__1::char_traits&lt;char&gt; &gt;::ostreambuf_iterator(std::__1::basic_ostream&lt;char, std::__1::char_traits&lt;char&gt; &gt;&amp;) in hello-1b0e0e.o
        std::__1::basic_ios&lt;char, std::__1::char_traits&lt;char&gt; &gt;::widen(char) const in hello-1b0e0e.o
        Dwarf Exception Unwind Info (__eh_frame) in hello-1b0e0e.o
  ld: symbol(s) not found for architecture x86_64
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  </code></pre>
  
  <p>I have already read these:</p>
  
  <p><a href="https://stackoverflow.com/questions/58278260/cant-compile-a-c-program-on-a-mac-after-upgrading-to-catalina-10-15">Can&#39;t compile a C program on a Mac after upgrading to Catalina 10.15</a></p>
  
  <p><a href="https://stackoverflow.com/questions/58144137/gcc-missing-headers-on-macos10-15-with-xcode11">GCC Missing Headers on macOS10.15 with Xcode11</a></p>
  
  <p><a href="https://stackoverflow.com/questions/52974321/compiling-with-gcc-in-macos-mojave">Compiling with gcc in macOS Mojave</a></p>
  
  <p>And I have already installed this: </p>
  
  <pre><code>/Library/Developer/CommandlineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
  </code></pre>