如何让 pugi XML 找到具有相对路径的文件。
我的文件夹看起来像这样
XML 文件位于此处
XMLConfiguration->_master_config.xml
配置->src
我把代码放在这里
pugi::xml_document doc;
pugi::xml_parse_result result = doc.load_file("../../XMLConfiguration/_master_config.xml");
std::cout << "Load result: " << result.description() << ", mesh name: " << doc.child("mesh").attribute("name").value() << std::endl;
当我运行代码时,我得到了这个:
Load result: File was not found, mesh name: