3

I want to learn YAML (and use it with C++) but i'm stuck trying to setup YAML-Cpp. Let me explain what i've done so far.

  • I downloaded the source code (version 0.5.1)
  • Installed Cmake (for Windows)
  • Installed the Boost libraries (precompiled for Visual Studio 2010)

EDIT:

  • Built the solution and the INSTALL project
  • Then i got two folders on my C drive: include and lib
  • Then i moved it to another folder on my D drive (maybe it's relevant)

For testing, i created a project in V Express and tried to compile this:

#include "yaml-cpp/yaml.h"

int main()
{
   YAML::Emitter out;
   out << "Hello, World!";

   std::cout << "Here's the output YAML:\n" << out.c_str();
   return 0;
}

The new result:

d:\development\yamlcpp 0.51\include\yaml-cpp\node\ptr.h(10): fatal error C1083: Cannot open include file: 'boost/shared_ptr.hpp': No such file or directory

Can somebody please tell me what is the right way to build and configure this library?

Marlon Dias
  • 55
  • 1
  • 7
  • 1
    What do you mean "nothing works"? Did it fail to compile? Link? Please post as much detail as possible, including complete source code that you tried compiling and complete error messages! – Jesse Beder Jan 21 '14 at 06:20

2 Answers2

0

It looks like you're not including the proper directory. In Visual Studio, there's an option for the "include directories" - make sure that the include directory for yaml-cpp is listed there.

Jesse Beder
  • 33,081
  • 21
  • 109
  • 146
  • Is it the one in Project Settings? I was tweaking some options yesterday and found it. Now my errors changed. I'll post more details. – Marlon Dias Jan 24 '14 at 01:20
0

marlon, you need to download boost-cpp (http://sourceforge.net/projects/boost/files/boost/1.58.0/), compile it and ensure to "include directory" in Visual Studio.