如何安装和使用YAML-Cpp [英] How to install and use YAML-Cpp
问题描述
我想学习YAML(并将其与C ++一起使用),但是我一直在尝试设置 YAML-Cpp . 让我解释一下到目前为止我做了什么.
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.
- 我下载了源代码(版本0.5.1)
- 已安装的Cmake(适用于Windows)
- 安装了Boost库(针对Visual Studio 2010进行了预编译)
- 构建解决方案和INSTALL项目
- 然后我的C盘上有两个文件夹:include和lib
- 然后我将其移动到D盘上的另一个文件夹中(也许是相关的)
为了进行测试,我在V Express中创建了一个项目,并尝试对其进行编译:
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;
}
新结果:
d:\ development \ yamlcpp 0.51 \ include \ yaml-cpp \ node \ ptr.h(10):致命错误C1083:无法打开包含文件:'boost/shared_ptr.hpp':没有此类文件或目录>
有人可以告诉我构建和配置该库的正确方法是什么吗?
Can somebody please tell me what is the right way to build and configure this library?
推荐答案
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.
这篇关于如何安装和使用YAML-Cpp的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!