# Error while Building sdk code exapmles using vs2005

**URL:** <https://forums.developer.nvidia.com/t/error-while-building-sdk-code-exapmles-using-vs2005/11037>\
**Category:** CUDA Programming and Performance\
**Created:** [July 21, 2009, 8:06pm UTC](https://forums.developer.nvidia.com/t/error-while-building-sdk-code-exapmles-using-vs2005/11037 "2009-07-21T20:06:37Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![simeranjitbrar14](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@simeranjitbrar14](https://forums.developer.nvidia.com/u/simeranjitbrar14)\
**Post date:** [July 21, 2009, 8:06pm UTC](https://forums.developer.nvidia.com/t/error-while-building-sdk-code-exapmles-using-vs2005/11037/1 "2009-07-21T20:06:37Z")

</div>

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 &)”

---

<div class="post-metadata">

**Author:** ![sansan](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@sansan](https://forums.developer.nvidia.com/u/sansan)\
**Post date:** [July 28, 2009, 9:43am UTC](https://forums.developer.nvidia.com/t/error-while-building-sdk-code-exapmles-using-vs2005/11037/2 "2009-07-28T09:43:54Z")

</div>

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]

---

<div class="post-metadata">

**Author:** ![sansan](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@sansan](https://forums.developer.nvidia.com/u/sansan)\
**Post date:** [July 28, 2009, 9:56am UTC](https://forums.developer.nvidia.com/t/error-while-building-sdk-code-exapmles-using-vs2005/11037/3 "2009-07-28T09:56:40Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![sansan](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@sansan](https://forums.developer.nvidia.com/u/sansan)\
**Post date:** [July 28, 2009, 2:59pm UTC](https://forums.developer.nvidia.com/t/error-while-building-sdk-code-exapmles-using-vs2005/11037/4 "2009-07-28T14:59:14Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![iJuliet](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@iJuliet](https://forums.developer.nvidia.com/u/iJuliet)\
**Post date:** [October 12, 2009, 2:39pm UTC](https://forums.developer.nvidia.com/t/error-while-building-sdk-code-exapmles-using-vs2005/11037/5 "2009-10-12T14:39:25Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Opencl\_jedi](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@Opencl\_jedi](https://forums.developer.nvidia.com/u/Opencl_jedi)\
**Post date:** [February 23, 2010, 2:37pm UTC](https://forums.developer.nvidia.com/t/error-while-building-sdk-code-exapmles-using-vs2005/11037/6 "2010-02-23T14:37:10Z")

</div>

> [@](#):
>
> 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

---

<div class="post-metadata">

**Author:** ![salmanmaslam](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@salmanmaslam](https://forums.developer.nvidia.com/u/salmanmaslam)\
**Post date:** [June 3, 2010, 10:22pm UTC](https://forums.developer.nvidia.com/t/error-while-building-sdk-code-exapmles-using-vs2005/11037/7 "2010-06-03T22:22:17Z")

</div>

> [@](#):
>
> 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.

---

<div class="post-metadata">

**Author:** ![salmanmaslam](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@salmanmaslam](https://forums.developer.nvidia.com/u/salmanmaslam)\
**Post date:** [June 9, 2010, 12:32am UTC](https://forums.developer.nvidia.com/t/error-while-building-sdk-code-exapmles-using-vs2005/11037/8 "2010-06-09T00:32:46Z")

</div>

> [@](#):
>
> Try changing the output directory to $(SolutionDir)\lib instead of just lib.

Fixed, thanks.

---

<div class="post-metadata">

**Author:** ![PatrickJianwenWang](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@PatrickJianwenWang](https://forums.developer.nvidia.com/u/PatrickJianwenWang)\
**Post date:** [September 29, 2010, 2:16pm UTC](https://forums.developer.nvidia.com/t/error-while-building-sdk-code-exapmles-using-vs2005/11037/9 "2010-09-29T14:16:19Z")

</div>

> [@](#):
>
> Try changing the output directory to $(SolutionDir)\lib instead of just lib.

**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?**

---

<div class="post-metadata">

**Author:** ![PatrickJianwenWang](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@PatrickJianwenWang](https://forums.developer.nvidia.com/u/PatrickJianwenWang)\
**Post date:** [September 29, 2010, 2:16pm UTC](https://forums.developer.nvidia.com/t/error-while-building-sdk-code-exapmles-using-vs2005/11037/10 "2010-09-29T14:16:19Z")

</div>

> [@](#):
>
> Try changing the output directory to $(SolutionDir)\lib instead of just lib.

**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?**
