title: Getting Xcode C++ linker error when trying to run an example using Armadillo library
body: <p>I am trying to run an example program (comes with installation of Armadillo library) in Xcode and getting the following error:</p>
  
  <blockquote>
    <p>linker command failed with exit code -1 (use -v for invocation)</p>
  </blockquote>
  
  <p>I can't figure out what's going in from Google searches.</p>
  
  <p>I can build and run the program on the command prompt using:</p>
  
  <blockquote>
    <p>g++ example1.cpp -O2 -larmadillo</p>
  </blockquote>
  
  <p>Here's my build setting:</p>
  
  <p><a href="https://i.stack.imgur.com/lBwp0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lBwp0.png" alt="enter image description here"></a></p>
  
  <p>Here's my search path to include the armadillo.h header:</p>
  
  <p><a href="https://i.stack.imgur.com/EYuV1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EYuV1.png" alt="enter image description here"></a></p>
  
  <p>My code is:</p>
  
  <p><a href="https://i.stack.imgur.com/4dPlq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4dPlq.png" alt="enter image description here"></a></p>
  
  <p>The actual error is:
  <a href="https://i.stack.imgur.com/PipmE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PipmE.png" alt="enter image description here"></a></p>