我是Objective-C和Xcode的新手。Xcode無法找到x86_64架構的符號
我試圖解析一個YAML文件從我的.mm文件。我決定使用yaml-cpp庫來完成這項任務。
我下載了source並將所有頭文件添加到我的項目。我可以包含yaml.h頭文件在我的.mm文件中,並且它已成功構建。
#include <yaml-cpp/yaml.h>
...
當我嘗試執行sample code,用下面的語句:
std::ifstream yamlReader("vmap3_styleattrs.yaml");
YAML::Parser yamlParser(yamlReader);
我收到以下錯誤:
Undefined symbols for architecture x86_64:
"YAML::Parser::Parser(std::__1::basic_istream<char, std::__1::char_traits<char> >&)", referenced from:
-[StyleSheetTests testGeoCSSTestAPIPrototype] in StyleSheetTests.o
"YAML::Parser::~Parser()", referenced from:
-[StyleSheetTests testGeoCSSTestAPIPrototype] in StyleSheetTests.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
有趣的是,它編譯第一次,但從那以後每一次連續的嘗試,構建都失敗了,上面的消息。
我想知道this question是否與我的情況有關,儘管我不確定。
我會很感激任何輸入。
你對源文件做了什麼? – immibis
@immibis,我將源文件物理複製到我的項目目錄,並在我的源代碼中引用它們。對於例如'#include'不會拋出錯誤,因爲我已將* yaml.h *頭文件複製到項目目錄中的* yaml-cpp *文件夾中。 –