C++ 为什么是;标准:执行“;在my c+中未识别命名空间+;(17) 节目?

C++ 为什么是;标准:执行“;在my c+中未识别命名空间+;(17) 节目?,c++,parallel-processing,c++17,C++,Parallel Processing,C++17,我正在编写一个基本程序(使用并行执行策略对整数向量“列表”进行排序)- 我使用运行C++17和gcc 9.3.0的Visual Studio代码作为编译器。我正在使用LinuxMint20作为我的操作系统。 请记住,我对Linux、VSCode、GCC/G++和C++17仍然是新手,因此可能会遗漏一些信息 有谁能告诉我可以做什么,和/或我错在哪里 编辑:我已经检查了std::execution的定义,我看到了这一点- #ifndef __PSTL_glue_execution_defs_H #d

我正在编写一个基本程序(使用并行执行策略对整数向量“列表”进行排序)-

我使用运行C++17和gcc 9.3.0的Visual Studio代码作为编译器。我正在使用LinuxMint20作为我的操作系统。 请记住,我对Linux、VSCode、GCC/G++和C++17仍然是新手,因此可能会遗漏一些信息

有谁能告诉我可以做什么,和/或我错在哪里

编辑:我已经检查了
std::execution
的定义,我看到了这一点-

#ifndef __PSTL_glue_execution_defs_H
#define __PSTL_glue_execution_defs_H

#include <type_traits>

#include "execution_defs.h"

namespace std
{
// Type trait
using __pstl::execution::is_execution_policy;
#if __PSTL_CPP14_VARIABLE_TEMPLATES_PRESENT
#if __INTEL_COMPILER
template <class T>
constexpr bool is_execution_policy_v = is_execution_policy<T>::value;
#else
using __pstl::execution::is_execution_policy_v;
#endif
#endif

namespace execution
{
// Standard C++ policy classes
using __pstl::execution::sequenced_policy;
#if __PSTL_USE_PAR_POLICIES
using __pstl::execution::parallel_policy;
using __pstl::execution::parallel_unsequenced_policy;
#endif
// Standard predefined policy instances
using __pstl::execution::seq;
#if __PSTL_USE_PAR_POLICIES
using __pstl::execution::par;
using __pstl::execution::par_unseq;
#endif
// Implementation-defined names
// Unsequenced policy is not yet standard, but for consistency
// we include it into namespace std::execution as well
using __pstl::execution::unseq;
using __pstl::execution::unsequenced_policy;
} // namespace execution
} // namespace std

#include "algorithm_impl.h"
#include "numeric_impl.h"
#include "parallel_backend.h"

#endif /* __PSTL_glue_execution_defs_H */
\ifndef\PSTL\u粘合\u执行\u定义
#定义粘合执行定义
#包括
#包括“执行定义h”
名称空间标准
{
//类型特征
使用pstl::execution::is_execution\u策略;
#如果存在变量模板
#如果英特尔编译器
模板
constexpr bool is_execution_policy_v=is_execution_policy::value;
#否则
使用pstl::execution::is_execution\u policy\u v;
#恩迪夫
#恩迪夫
命名空间执行
{
//标准C++策略类
使用_pstl::execution::sequenced_策略;
#如果使用相同的策略
使用pstl::execution::parallel_策略;
使用_pstl::execution::parallel_unsequenced_策略;
#恩迪夫
//标准预定义策略实例
使用pstl::execution::seq;
#如果使用相同的策略
使用pstl::execution::par;
使用_pstl::execution::par_unseq;
#恩迪夫
//实现定义的名称
//未排序的策略还不是标准的,而是为了一致性
//我们还将其包含在命名空间std::execution中
使用pstl::execution::unseq;
使用pstl::execution::unsequenced_策略;
}//命名空间执行
}//名称空间std
#包括“算法\u impl.h”
#包括“数字\u impl.h”
#包括“parallel_backend.h”
#endif/*\uuuPSTL\uGlue\u执行\uDefs\uH*/

您可能缺少
-std=c++17
?这是重复的吗?阅读时,您可能也缺少
-ltbb
[Kabanus],我该如何使用它,
-std=c++17
?您似乎缺少
tbb
库。您可以尝试删除
-ltbb
,看看这是否有效,尽管我对此表示怀疑,。如果没有,您将必须弄清楚如何在您的系统上安装它。
/home/test.cpp:12:18: error: ‘std::execution’ has not been declared
   12 |   std::sort(std::execution::par, list.begin(), list.end());
      |                  ^~~~~~~~~
The terminal process "/bin/bash '-c', '/usr/bin/g++ -g '/home/test.cpp' -o '/home/test''" terminated with exit code: 1.
#ifndef __PSTL_glue_execution_defs_H
#define __PSTL_glue_execution_defs_H

#include <type_traits>

#include "execution_defs.h"

namespace std
{
// Type trait
using __pstl::execution::is_execution_policy;
#if __PSTL_CPP14_VARIABLE_TEMPLATES_PRESENT
#if __INTEL_COMPILER
template <class T>
constexpr bool is_execution_policy_v = is_execution_policy<T>::value;
#else
using __pstl::execution::is_execution_policy_v;
#endif
#endif

namespace execution
{
// Standard C++ policy classes
using __pstl::execution::sequenced_policy;
#if __PSTL_USE_PAR_POLICIES
using __pstl::execution::parallel_policy;
using __pstl::execution::parallel_unsequenced_policy;
#endif
// Standard predefined policy instances
using __pstl::execution::seq;
#if __PSTL_USE_PAR_POLICIES
using __pstl::execution::par;
using __pstl::execution::par_unseq;
#endif
// Implementation-defined names
// Unsequenced policy is not yet standard, but for consistency
// we include it into namespace std::execution as well
using __pstl::execution::unseq;
using __pstl::execution::unsequenced_policy;
} // namespace execution
} // namespace std

#include "algorithm_impl.h"
#include "numeric_impl.h"
#include "parallel_backend.h"

#endif /* __PSTL_glue_execution_defs_H */