gpt4 book ai didi

c++ - 我的编译器上的策略数据结构不起作用

转载 作者:行者123 更新时间:2023-12-02 10:56:25 26 4
gpt4 key购买 nike

我想使用基于策略的数据结构,但是我的编译器一直在给我错误。
这是即时通讯在我的代码中使用的:

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
template <typename T> using oset = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
这是我收到的错误消息:
fatal error: 
'ext/typelist.h' file not found
#include <ext/typelist.h>
error: function-like macro
'__GLIBC_PREREQ' is not defined
#if __GLIBC_PREREQ(2,15) && defined(_GNU_SOURCE)
我已经尝试过一遍又一遍地替换文件,但是它一直告诉我要不断添加计算机没有的新文件。我在Mac上使用VS Code。谢谢。

最佳答案

__GLIBC_PREREQ宏是在<cstdlib>中定义的,因此不能保证默认情况下会包含该宏。看来您已经省略了一些重要的头文件,或者这些头文件的实现不包含<cstdlib>PBDS requirec gcc,说您使用VSCode IDE不会告诉您所使用的编译器。

关于c++ - 我的编译器上的策略数据结构不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62695430/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com