OpenCL 2.x(C++ 绑定):未定义的标识符

OpenCL 2.x(C++ bindings): undefined identifier

编辑: 在 visual studio 的库文件部分添加 OpenCL.lib 解决了问题。

由于 this github repository 中的 cl2.hpp 由 khronos 站点指出,当我尝试使用要导出的 OpenCL-C++ 实现函数编译 C++ dll 项目时,我得到 60-70 个类似的错误。

'CL_DEVICE_QUEUE_ON_HOST_PROPERTIES': undeclared identifier
// I'm not using this, I'm newly converting a v1.2 C++ binding-based
// project to a v2.0 one

文件的开头是:

using namespace std;
#define __CL_ENABLE_EXCEPTIONS
#include <CL\cl2.hpp>

其余行未加红色下划线(visual studio)。我可能需要添加一些编译时常量,但我不知道是哪些常量。

缺少什么?

此代码(项目中没有任何其他代码)也给出相同的错误:

#include <CL\cl2.hpp>

我遇到了同样的错误,对我有用的是在 #include <cl2.hpp>

之前添加以下内容
#define CL_HPP_TARGET_OPENCL_VERSION 120
#define CL_HPP_MINIMUM_OPENCL_VERSION 120
#include <cl2.hpp>