プロジェクトでyaml-cpp 0.3.0を使用しようとして苦労しています.yamlをダウンロードし、http: //code.google.com/p/yaml-cpp/のようにVS 9 2008 WIN 64でビルドしました. それで、私は yaml-cpp.dll と yaml-cpp.lib を手に入れました 私は VS 2010 Express で C++ プロジェクトを持っていて、ライブラリをリンクしようとしています: 私はプロジェクトのプロパティに行きます - c/c++ general and additional include yaml-cpp ヘッダー ファイルがあるディレクトリ。次に、リンカーに移動して lib ディレクトリにパスを追加し、次にリンカーに移動して .lib ファイルを入力して追加します。次に、VC++ ディレクトリに移動し、ライブラリ ディレクトリと参照ディレクトリに lib ディレクトリへのパスを追加します。この単純なコードをビルドします。
std::ifstream fin("test.yaml");
YAML::Parser parser(fin);
YAML::Node doc;
while(parser.GetNextDocument(doc)) {
//do nothing yet
}
次のように、いくつかのリンクの問題が発生しました。
error LNK2019: unresolved external symbol "public: __thiscall YAML::Node::Node(void)" (??0Node@YAML@@QAE@XZ) referenced in function "public: __thiscall Parser::Parser(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (??0Parser@@QAE@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
error LNK2019: unresolved external symbol "public: __thiscall YAML::Parser::~Parser(void)" (??1Parser@YAML@@QAE@XZ) referenced in function "public: __thiscall Parser::Parser(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (??0Parser@@QAE@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
誰でも私を助けることができますか?ここで壁に頭をぶつけています。