yocto - 无法在 SDK 中链接文件系统库
问题描述
我在使用 SDK 编译时尝试使用 C++17 中的文件系统库。我用了这个例子。
#include <string>
#include <filesystem>
int main() {
const std::string path = "/tmp/";
for (const auto & entry : std::filesystem::directory_iterator(path))
std::cout << entry.path() << std::endl;
}
链接库时出现问题(仅在使用 SDK 编译时,它适用于 Ubuntu。)
我应该以某种方式为 SDK 启用 c++17 吗?
还是应该将 stdc++fs 库添加到 SDK?
解决方案
TOOLCHAIN_TARGET_TASK_append = " libstdc++-staticdev"
推荐阅读
- java - Java:遇到 ConcurrentModificationException。我的迭代器和/或 HashMap 有问题,我不知道它是什么
- android - 在没有firebase的android中集成苹果登录功能
- html - 有没有办法在 HTML/CSS 中制作对鼠标单击“透明”的图像?
- python - 根据来自其他数据框的匹配更新数据框新列
- php - Blade 在尝试显示 Json 数据时返回“1”
- c++ - 如何使用c++交换功能?
- mysql - R 使用 RMariaDB 无法连接 .mylogin.cnf
- spring-mvc - 将 Spring 从 Jboss 迁移到 Wildfly 将导致“无法自动装配”
- extjs - 在 Ext.grid.Panel 中自动选择第一行
- sql - SQL 最少收入位置计数