私はこの種の問題のために雷に追い込まれたと思います。 OpenCLを使用してデバイスによって計算された結果を示すQOpenglWidgetを作成するために、私はqt5.6.0(msvc2015_64)でVisual Studio 2015コミュニティを使用しています。wglGetCurrentDC未解決外部
は今、私は「wglGetCurrentContext」と「wglGetCurrentDC」機能を使用して、コンテキストを作成するブラインドよ、エラーは以下のとおりです。
保護された「LNK2019未解決の外部シンボルは、関数の中で参照_imp_wglGetCurrentContext」:無効_cdecl VolRenGL :: createCLContext( LNK2019未解決の外部シンボル_imp_wglGetCurrentDC関数 "protected:void _cdecl VolRenGL :: createCLContext(int、char const *)"(?createCLContext(int、char const * ) @ VolRenGL @@ IEAAXHPEAPEBD @ Z) "
関連コード:
cl_context_properties props[] =
{
CL_GL_CONTEXT_KHR, (cl_context_properties)wglGetCurrentContext(),
CL_WGL_HDC_KHR, (cl_context_properties)wglGetCurrentDC(),
CL_CONTEXT_PLATFORM, (cl_context_properties)cpPlatform,
0
};
cxGPUContext = clCreateContext(props, 1, &cdDevices[uiDeviceUsed], NULL, NULL, &err);
QOpenGLWidgetを使用している場合は、あなたのためにそれをやっています。もっとコードを投稿できますか? – wasthishelpful
@wasthishelpful:OPはOpenGL interopでOpenCLコンテキストを作成しようとします。これを行う唯一の方法は、 'wglGetCurrentDC'が対象とするネイティブプラットフォームGLコンテキストへのハンドルを取得することです。 – datenwolf