title: Xcode 8 - c++ - Undefined symbols for architecture x86_64: "liblas::Reader....."
body: <p>I am currently working on a c++ project using xcode 8, and I keep getting this error:</p>
  
  <pre><code>Undefined symbols for architecture x86_64:
  "liblas::Reader::Reader(std::__1::basic_istream&lt;char, std::__1::char_traits&lt;char&gt; &gt;&amp;)", referenced from:
    _main in main.o
  "liblas::Reader::~Reader()", referenced from:
    _main in main.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 compiled boost, liblas, etc. I have it included in my cmakelists.txt as well, and have the folder it is included in listed in 'Framework Search Paths' as well as 'Header Search Paths'. My compiler is the xcode 8 default of Apple LLVM 8.0. My deployment target is 10.11. The valid architectures are 'x86_64' and 'i386'. </p>
  
  <p>Here is the code that attempts to use libLAS (file.las contains a hardcoded path to my las file). This code was pulled directly off the libLAS c++ tutorial <a href="http://www.liblas.org/tutorial/cpp.html" rel="nofollow noreferrer">here</a>:</p>
  
  <pre><code>std::ifstream ifs;
  ifs.open("file.las", std::ios::in | std::ios::binary);
  liblas::ReaderFactory f;
  liblas::Reader reader = f.CreateWithStream(ifs);
  </code></pre>
  
  <p>If I comment out the line <code>liblas::Reader reader = f.CreateWithStream(ifs);</code>, the code compiles fine, and produces a valid executable. With this line here, it throws the error. I need to be able to read LAS files with this project however, so I need to try to get the Reader to work.</p>
  
  <p>So my questions are:</p>
  
  <ol>
  <li><p>Is there a better way to debug this?</p></li>
  <li><p>Is this an obvious error that I'm missing?</p></li>
  <li><p>Is this an issue with the library? (libLAS)</p></li>
  <li><p>What can I do to get this working?</p></li>
  </ol>
  
  <p>Thanks to anyone in advance! </p>