I am very new to yaml-cpp , I tried a simple program, but could not, and also did not find an answer from the author google / github site.
#include <iostream> #include "yaml-cpp/yaml.h" using namespace std; int main() { YAML::Node config = YAML::LoadFile("sample.yaml"); return 0; }
sample.yaml sample from the official YAML website
---! clarkevans.com/^invoice
invoice: 34843
date: 2001-01-23
bill-to: & 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:>
Late afternoon is best.
Backup contact is nancy
Billsmer @ 338-4338.
The error message is displayed as follows:
libC ++ abi.dylib: termination with an uncaught exception of type YAML :: BadFile: yaml-cpp: error in row 0, column 0: bad file
May I find out what the problem is? Is this a problem with building a library, or is it a YAML or API syntax problem using the problem?
development environment
MacOSX10.9 c++11 IDE:QtCreator3.0.1 yaml-cpp 0.5.1
[SOLVED]
I made a stupid mistake that I loaded the wrong sample.yaml path.
source share