title: Error reading a Trajectory File using Chemfiles library
body: <p>I need to write a piece of cpp code that will read a trajectory file (.pdb or .dcd files). I have followed the steps on the homepage of <a href="http://chemfiles.org/chemfiles/0.6.0/example.html" rel="nofollow noreferrer">chemfiles</a> library to read in the file. I am getting an error about undefined symbols for architecture x86_64 (please see a piece of the error log below).</p>
  
  <p>What I want: Able to read the .dcd/.pdb file using the chemfiles library (or any other suitable library to do so) - I need to access the coordinates of the atoms listed in the file.</p>
  
  <p>Code that reproduces the error when compiled using the command below:</p>
  
  <pre><code>#include "/usr/local/include/chemfiles.hpp" //path to library on my mac
  
  int main(int argc, char *argv[]) {
      chemfiles::Trajectory testfile("test.dcd");
      return 1;
  }
  </code></pre>
  
  <p>Code that compiles successfully in CLI using the command below:</p>
  
  <pre><code>#include "/usr/local/include/chemfiles.hpp" //path to library on my mac
  
  int main(int argc, char *argv[]) {
      // chemfiles::Trajectory testfile("test.dcd");
      return 1;
  }
  </code></pre>
  
  <p>Command to compile program:</p>
  
  <pre><code>g++-8 -fopenmp trial.cpp -o trial -lchemfiles -L /usr/local/lib
  // I am using openmp because my original code is about parallelisation with openmp
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>Undefined symbols for architecture x86_64:
    "chemfiles::Trajectory::Trajectory(std::__cxx11::basic_string&lt;char, 
  std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, char, 
  std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, 
  std::allocator&lt;char&gt; &gt; const&amp;)", referenced from:
    _main in ccnk7agz.o
    "std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, 
  std::__1::allocator&lt;char&gt; &gt;::find(char, unsigned long) const", 
  referenced from:
        file_open_info::parse(std::__1::basic_string&lt;char, 
  std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt; const&amp;, 
  std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, 
  std::__1::allocator&lt;char&gt; &gt; const&amp;) in libchemfiles.a(Trajectory.cpp.o)
        split_comment(std::__1::basic_string&lt;char, 
  std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt;&amp;) in 
  libchemfiles.a(LAMMPSData.cpp.o)
    "std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, 
  std::__1::allocator&lt;char&gt; &gt;::rfind(char, unsigned long) const", 
  referenced from:
        file_open_info::parse(std::__1::basic_string&lt;char,  
  std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt; const&amp;, 
  std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, 
  std::__1::allocator&lt;char&gt; &gt; const&amp;) in libchemfiles.a(Trajectory.cpp.o)
        chemfiles::SDFFormat::read(chemfiles::Frame&amp;) in 
  libchemfiles.a(SDF.cpp.o)
    "std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, 
  std::__1::allocator&lt;char&gt; &gt;::compare(unsigned long, unsigned long, char 
  const*, unsigned long) const", referenced from:
        file_open_info::parse(std::__1::basic_string&lt;char, 
  std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt; const&amp;, 
  std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, 
  std::__1::allocator&lt;char&gt; &gt; const&amp;) in libchemfiles.a(Trajectory.cpp.o)
        chemfiles::Trajectory::Trajectory(std::__1::basic_string&lt;char, 
  std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt;, char, 
  std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, 
  std::__1::allocator&lt;char&gt; &gt; const&amp;) in libchemfiles.a(Trajectory.cpp.o)
        chemfiles::FormatFactory::register_format(chemfiles::FormatInfo, 
  std::__1::function&lt;std::__1::unique_ptr&lt;chemfiles::Format, 
  std::__1::default_delete&lt;chemfiles::Format&gt; &gt; 
  (std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, 
  std::__1::allocator&lt;char&gt; &gt;, chemfiles::File::Mode, 
  chemfiles::File::Compression)&gt;) in libchemfiles.a(FormatFactory.cpp.o)
        chemfiles::Frame::guess_bonds()     in 
  libchemfiles.a(Frame.cpp.o)
        chemfiles::FormatInfo::FormatInfo(std::__1::basic_string&lt;char, 
  std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt;) in 
  libchemfiles.a(CSSR.cpp.o)
        chemfiles::FormatInfo::FormatInfo(std::__1::basic_string&lt;char, 
  std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt;) in 
  libchemfiles.a(MMTF.cpp.o)
        chemfiles::MOL2Format::read(chemfiles::Frame&amp;) in 
  libchemfiles.a(MOL2.cpp.o)
        ...
  </code></pre>