c++ - 使用已编译的 gcc 编译我的代码,但找不到某些头文件
问题描述
我从源代码编译 gcc9,并使用默认安装前缀:
./configure --disable-mutilib
make -j16
make install
之后,我发现 gcc 版本更新了:
which gcc
/usr/local/bin/gcc
gcc --version
gcc (GCC) 9.1.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
但是,当我在我的代码中使用它时:
#include <filesystem>
....
当我使用默认系统 gcc 时,我使用 cmake 编译它:
mkdir -p build
cmake ..
make
我得到了以下错误:
/root/cpp/main_demo.cpp:17:22:致命错误:文件系统:没有此类文件或目录编译终止。...
我确定该文件filesystem
存在于我的安装路径中,因为我可以使用 `find /usr/local -iname ' filesystem ' 找到它。
我错过了什么,我怎样才能让它发挥作用?
解决方案
推荐阅读
- c# - 向文本文件中的现有文本添加空格和字符
- requirejs - 为“base”requirejs 配置创建命名空间别名
- cluster-analysis - 基于密度的聚类验证 (DBCV) 永远不会停止运行
- lldb - 为什么 lldb 抱怨我的类需要一个转换运算符,即使它有一个?
- mysql - 在创建表时具有具有默认值的“创建日期”列
- jboss - 如何更改 jboss 时区?Java 属性不起作用
- firebase - Firestore在更新后获取Field.increment的值而不读取文档数据
- rest - 验证 API 响应
- powershell - 如何将下面的代码转换为 powershell 代码
- sql - SQL - 搜索不带空格的 WHERE 子句