title: How to load YAML file via yaml-cpp?
body: <p>I am very new to <a href="https://code.google.com/p/yaml-cpp/" rel="nofollow noreferrer"><code>yaml-cpp</code></a>. I tried the simplest program, but it failed and, and I couldn't find the answer from GitHub repository.</p>
  <pre class="lang-cpp prettyprint-override"><code>#include &lt;iostream&gt;
  #include &quot;yaml-cpp/yaml.h&quot;
  
  using namespace std;
  
  int main()
  {
      YAML::Node config = YAML::LoadFile(&quot;sample.yaml&quot;);
      return 0;
  }
  </code></pre>
  <p><a href="http://www.yaml.org/start.html" rel="nofollow noreferrer"><code>sample.yaml</code></a> sample from the official YAML website:</p>
  <pre class="lang-yaml prettyprint-override"><code>--- !clarkevans.com/^invoice
  invoice: 34843
  date   : 2001-01-23
  bill-to: &amp;id001
      given  : Chris
      family : Dumars
      address:
          lines: |
              458 Walkman Dr.
              Suite #292
          city    : Royal Oak
          state   : MI
          postal  : 48046
  ship-to: *id001
  product:
      - sku         : BL394D
        quantity    : 4
        description : Basketball
        price       : 450.00
      - sku         : BL4438H
        quantity    : 1
        description : Super Hoop
        price       : 2392.00
  tax  : 251.42
  total: 4443.52
  comments: &gt;
      Late afternoon is best.
      Backup contact is Nancy
      Billsmer @ 338-4338.
  </code></pre>
  <p>This is the error message:</p>
  <pre><code>libc++abi.dylib: terminating with uncaught exception of type YAML::BadFile: yaml-cpp: error at line 0, column 0: bad file
  </code></pre>
  <p>Is it the library building problem or a YAML syntax problem or an issue with my API usage?</p>
  <p>I am using <code>yaml-cpp</code> version 0.5.1.</p>