Error while Building sdk code exapmles using vs2005

I am trying to build the sample code in opencl SDk. I am getting this

error.>Linking…
3>oclUtils32D.lib(shrUtils.obj) : error LNK2019: unresolved external symbol “public: static void __cdecl std::_Locinfo::_Locinfo_ctor(class std::_Locinfo *,class std::basic_string<char,struct std::char_traits,class std::allocator > const &)”

Hi simeranjitbrar14!

Have you resolved this problem?

Today I’ve encountered the same problem on WinXP-64bit with Microsoft Visual Studio 2005 Version 8.0.50727.762 (SP.050727-7600):

[codebox]1>Linking…

1>oclUtils64D.lib(shrUtils.obj) : error LNK2019: unresolved external symbol “public: static void __cdecl std::_Locinfo::_Locinfo_ctor(class std::_Locinfo *,class std::basic_string<char,struct std::char_traits,class std::allocator > const &)” (?_Locinfo_ctor@_Locinfo@std@@SAXPEAV12@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@@Z) referenced in function “public: __cdecl std::_Locinfo::_Locinfo(class std::basic_string<char,struct std::char_traits,class std::allocator > const &)” (??0_Locinfo@std@@QEAA@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@1@@Z)

1>oclUtils64D.lib(cmd_arg_reader.obj) : error LNK2001: unresolved external symbol “public: static void __cdecl std::_Locinfo::_Locinfo_ctor(class std::_Locinfo *,class std::basic_string<char,struct std::char_traits,class std::allocator > const &)” (?_Locinfo_ctor@_Locinfo@std@@SAXPEAV12@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@@Z)[/codebox]

The missing symbol can be found in shrUtils64D.lib in my case, nevertheless I did not manage to make MS VC++ linker use it so far, even if the related project settings look ok :(

Here is the VS2005 linker command line, probably it might help:

[codebox]/OUT:"…\bin\Win64\Debug\oclDotProduct.exe" /INCREMENTAL /LIBPATH:"…/…/common/lib" /LIBPATH:"…/…/…/shared/lib"

/LIBPATH:"…/…/common/lib/WinXP64" /MANIFEST /MANIFESTFILE:“Debug\oclDotProduct.exe.intermediate.manifest”

/DEBUG /PDB:“d:\Documents and Settings\All Users\Application Data\NVIDIA Corporation\NVIDIA GPU Computing SDK\OpenCL\bin\Win64\Debug\oclDotProduct.pdb”

/SUBSYSTEM:CONSOLE /MACHINE:X64 /ERRORREPORT:PROMPT

oclUtils64D.lib libOpenCL64.lib shrUtils64D.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib[/codebox]

I have tried changing the order of OpenCL libs but it does not help.

The same problem exists if I install 32-bit OpenCL SDK and try to build some sample application for Win32 platform :(

Any help from experienced OpenCL SDK users would be really appreciated!

To resolve this problem, one needs to rebuild shrUtils32/64(D).lib and oclUtils32/64(D).lib with VS2005.
For some reason it helps.

Most likely this is due to a newer Visual Studio version used to build the pre-compiled versions of these static libs that come along with OpenCL SDK distribution.
I believe a general rule should sound like this:
Make sure all OpenCL libs are built with the Visual Studio version you are going to use for building your OpenCL application”.

It would be great if OpenCL SDK Release Notes document contained a note concerning this issue. Now it does not.

Yes, I rebuild the NVIDIA GPU Computing SDK\OpenCL\common\oclUtils.sln, and everything goes well now.

Strongly recommend writing this into the readme.txt, it is really fuzzy and makes user uncomfortable to meet this link error when running the first OCL program
Moreover, OCL isn’t as friendly as CUDA, really lengthy and tedious host code.

Hi,

I’m having the same problem, when I build my project I get

1>Creating library…

1>LINK : fatal error LNK1104: cannot open file ‘lib\shrUtils32D.lib’

I’m working with visual c++ 2008 express edition, I tried to rebuild the NVIDIA GPU Computing SDK\OpenCL\common\oclUtils.sln

but I still get the same error message.

Please help.

Thanks

Try changing the output directory to $(SolutionDir)\lib instead of just lib.

Fixed, thanks.

I did that, but when I try to use VC++ 2008 express to rebuild the shrUtils_vc90.sln and oclUtils_vc9.sln, it’s reported:

1>------ Rebuild All started: Project: shrUtils, Configuration: Debug Win32 ------

1>Deleting intermediate and output files for project ‘shrUtils’, configuration ‘Debug|Win32’

1>shrUtils : error PRJ0008 : Could not delete file ‘c:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK\shared\lib\shrUtils32D.lib’.

1>Make sure that the file is not open by another process and is not write-protected.

1>shrUtils - 1 error(s), 0 warning(s)

2>------ Rebuild All started: Project: oclUtils, Configuration: Debug Win32 ------

2>Deleting intermediate and output files for project ‘oclUtils’, configuration ‘Debug|Win32’

2>oclUtils : error PRJ0008 : Could not delete file ‘c:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK\OpenCL\common\lib\oclUtils32D.lib’.

2>Make sure that the file is not open by another process and is not write-protected.

2>oclUtils - 1 error(s), 0 warning(s)

========== Rebuild All: 0 succeeded, 2 failed, 0 skipped ==========

Could anyone tell me how to deal with this problem?

I did that, but when I try to use VC++ 2008 express to rebuild the shrUtils_vc90.sln and oclUtils_vc9.sln, it’s reported:

1>------ Rebuild All started: Project: shrUtils, Configuration: Debug Win32 ------

1>Deleting intermediate and output files for project ‘shrUtils’, configuration ‘Debug|Win32’

1>shrUtils : error PRJ0008 : Could not delete file ‘c:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK\shared\lib\shrUtils32D.lib’.

1>Make sure that the file is not open by another process and is not write-protected.

1>shrUtils - 1 error(s), 0 warning(s)

2>------ Rebuild All started: Project: oclUtils, Configuration: Debug Win32 ------

2>Deleting intermediate and output files for project ‘oclUtils’, configuration ‘Debug|Win32’

2>oclUtils : error PRJ0008 : Could not delete file ‘c:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK\OpenCL\common\lib\oclUtils32D.lib’.

2>Make sure that the file is not open by another process and is not write-protected.

2>oclUtils - 1 error(s), 0 warning(s)

========== Rebuild All: 0 succeeded, 2 failed, 0 skipped ==========

Could anyone tell me how to deal with this problem?