OpenCL* for CPU
Ask questions and share information on Intel® SDK for OpenCL™ Applications and OpenCL™ implementations for Intel® CPU.
Announcements
This forum covers OpenCL* for CPU only. OpenCL* for GPU questions can be asked in the GPU Compute Software forum. Intel® FPGA SDK for OpenCL™ questions can be ask in the FPGA Intel® High Level Design forum.
1718 Discussions

OpenCL C++ compiler problem

Kirill_L_
Beginner
620 Views

Hi,

I have Windows 8.1 64-bit, Intel OpenCL SDK 4.6, Visual Studio 2013 Express Edition. Also I have added all nessesary directories in the project properties (include directory, lib directory and OpenCL.lib file for linker). Program is very simple:

#include <CL\cl.hpp>

int main() {
     return 0;
}

But I can't compile it: error C4996: 'clCreateSampler': was declared deprecated.

Do you have any ideas, how to solve this problem?

Thank you!

 

0 Kudos
3 Replies
Robert_I_Intel
Employee
620 Views

Dear Kirill, 

C4996 should be a warning (see http://msdn.microsoft.com/en-us/library/ttcz0bys.aspx ). Probably, in your project you set to treat level 3 warnings (or all warnings) as errors. Check whether you are setting one of the following flags http://msdn.microsoft.com/en-us/library/thxezb7y.aspx in Visual Studio and disable them. Warning about clCreateSampler is OK, if you don't want to see it, you can define _CRT_SECURE_NO_WARNINGS.

0 Kudos
Kirill_L_
Beginner
620 Views

Robert Ioffe (Intel) wrote:

Dear Kirill, 

C4996 should be a warning (see http://msdn.microsoft.com/en-us/library/ttcz0bys.aspx ). Probably, in your project you set to treat level 3 warnings (or all warnings) as errors. Check whether you are setting one of the following flags http://msdn.microsoft.com/en-us/library/thxezb7y.aspx in Visual Studio and disable them. Warning about clCreateSampler is OK, if you don't want to see it, you can define _CRT_SECURE_NO_WARNINGS.

Disabling of SDL checks was helpful)

Thank you!

0 Kudos
Jurczak__Paul
New Contributor I
620 Views

I had the same problem and disabling SDL checks solved it. Defining _CRT_SECURE_NO_WARNINGS had no effect.

0 Kudos
Reply