title: Compilation error with C++ (macOS)
body: <p>I am getting an error when I am trying to compile this very simple C++ program in Mac (HighSierra: Version 10.13.3). The gcc version being used in this Mac is 5.3.0.</p>
  
  <p>This is the C++ program:</p>
  
  <pre><code>#include&lt;iostream&gt;
  #include&lt;cmath&gt;
  #include&lt;fstream&gt;
  using namespace std;
  
  int main() 
  {
    cout&lt;&lt;sin(1);
  } 
  </code></pre>
  
  <p>Following an answer from an earlier question, I installed command line tools using <code>xcode-select --install</code></p>
  
  <p>After the aforementioned command line installation, when I try to compile this program using</p>
  
  <pre><code>gcc filename.cpp -o filename.out
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>/var/folders/mp/z7xpkw3538z71904cdqhztv00000gn/T//ccGJEHr7.s:24:11: warning: section "__textcoal_nt" is deprecated
      .section __TEXT,__textcoal_nt,coalesced,pure_instructions
               ^      ~~~~~~~~~~~~~
  /var/folders/mp/z7xpkw3538z71904cdqhztv00000gn/T//ccGJEHr7.s:24:11: note: change section name to "__text"
      .section __TEXT,__textcoal_nt,coalesced,pure_instructions
               ^      ~~~~~~~~~~~~~
  Undefined symbols for architecture x86_64:
    "std::basic_ostream&lt;char, std::char_traits&lt;char&gt; &gt;::operator&lt;&lt;(double)", referenced from:
        _main in ccpjcybF.o
    "std::ios_base::Init::Init()", referenced from:
        __static_initialization_and_destruction_0(int, int) in ccpjcybF.o
    "std::ios_base::Init::~Init()", referenced from:
        __static_initialization_and_destruction_0(int, int) in ccpjcybF.o
    "std::cout", referenced from:
        _main in ccpjcybF.o
  ld: symbol(s) not found for architecture x86_64
  collect2: error: ld returned 1 exit status
  </code></pre>
  
  <p>How can I solve this problem?</p>
  
  <hr>
  
  <p><strong>Update:</strong></p>
  
  <p>Following the answers, now I used <code>g++</code>, i.e.</p>
  
  <pre><code>g++ filename.cpp -o filename.out
  </code></pre>
  
  <p>Now, I am getting the following error:</p>
  
  <pre><code>/var/folders/mp/z7xpkw3538z71904cdqhztv00000gn/T//ccJjEuJy.s:24:11: warning: section "__textcoal_nt" is deprecated
      .section __TEXT,__textcoal_nt,coalesced,pure_instructions
               ^      ~~~~~~~~~~~~~
  /var/folders/mp/z7xpkw3538z71904cdqhztv00000gn/T//ccJjEuJy.s:24:11: note: change section name to "__text"
      .section __TEXT,__textcoal_nt,coalesced,pure_instructions
               ^      ~~~~~~~~~~~~~
  </code></pre>