Closed GoogleCodeExporter closed 8 years ago
When you run cmake, add the argument -DYAML_CPP_BUILD_OLD_API=OFF
Original comment by jbe...@gmail.com
on 15 Nov 2011 at 7:11
Thanks!
But now I have another error when I compile my test program, see attach:
And my test code is:
#include "yaml-cpp/node/parse.h"
#include "yaml-cpp/node/node.h"
#include <string>
#include <iostream>
#include <fstream>
using namespace std;
int main (int argc, char const* argv[])
{
fstream fin("./1.yaml");
YAML::Node config = YAML::Load(fin);
cout << config["username"].as<string>() << endl;
fin.close();
return 0;
}
Is my test code right?
Original comment by Garcia.relax@gmail.com
on 15 Nov 2011 at 11:11
Attachments:
You aren't linking with yaml-cpp. You need to pass gcc the argument -lyaml-cpp,
and make sure that libyaml-cpp.a is in your linker path.
Original comment by jbe...@gmail.com
on 15 Nov 2011 at 4:29
Original issue reported on code.google.com by
Garcia.relax@gmail.com
on 15 Nov 2011 at 6:59