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.

linking the opencl library in visual studio

Piyush_K_
Beginner
1,695 Views

Hi guys,

Can you tell me how to link the library files in visual studio as I am getting the LNK error : unresolved externals _someFuncName;

I did try to link it as project property->configurations->linker->input additional library and typed the complete path of the OpenCL64.lib

But still it is gibing the same error.......

 

Thanks

Piyush

0 Kudos
1 Solution
Yuri_K_Intel
Employee
1,695 Views
The name of the library to link with is OpenCL.lib, not OpenCL64.lib. So specify just OpenCL.lib in Linker->Input->Additional dependencies. And specify a path to its folder using INTELOCLSDKROOT environment variable in Linker->General->Additional library directories: $(INTELOCLSDKROOT)\lib\x64 or $(INTELOCLSDKROOT)\lib\x86 in 32-bit configuration. Thanks, Yuri

View solution in original post

0 Kudos
3 Replies
Yuri_K_Intel
Employee
1,696 Views
The name of the library to link with is OpenCL.lib, not OpenCL64.lib. So specify just OpenCL.lib in Linker->Input->Additional dependencies. And specify a path to its folder using INTELOCLSDKROOT environment variable in Linker->General->Additional library directories: $(INTELOCLSDKROOT)\lib\x64 or $(INTELOCLSDKROOT)\lib\x86 in 32-bit configuration. Thanks, Yuri
0 Kudos
Piyush_K_
Beginner
1,695 Views

@ yuri,

thanks boss for helping a lot.... One last time if you can help me with linux library set up, I will get going with my project.
I am getting this particular error every time and with every sdk in linux
/usr/bin/ld: cannot find -lOpenCL
collect2: error: ld returned 1 exit status

 

 

Just dont know whats wrong with my installation???

 

0 Kudos
Raghupathi_M_Intel
1,695 Views

You probably have to update your LIB path to include the path to OpenCL library.

Raghu

0 Kudos
Reply