# using pvrtc lib

**URL:** <https://forums.imgtec.com/t/using-pvrtc-lib/962>\
**Category:** PowerVR Insider\
**Created:** [January 5, 2011, 6:52pm UTC](https://forums.imgtec.com/t/using-pvrtc-lib/962 "2011-01-05T18:52:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![deep](https://avatars.discourse-cdn.com/v4/letter/d/ce7236/32.png) [@deep](https://forums.imgtec.com/u/deep)\
**Post date:** [January 5, 2011, 6:52pm UTC](https://forums.imgtec.com/t/using-pvrtc-lib/962/1 "2011-01-05T18:52:48Z")

</div>

I’m trying to use the pvrtc texture compression library.&nbsp; When I use the DLL version (UtilitiesPVRTCdll) everything compiles and works correctly, however, I’d like to avoid the external dependency.&nbsp; When I try to link w/ the lib version (UtilitiesPVRTClib), however, I get the following errors:  
  
&nbsp;1\>LIBCMTD.lib(dbgheap.obj) : error LNK2005: \_\_malloc\_dbg already defined in MSVCRTD.lib(MSVCR90D.dll)  
1\>LIBCMTD.lib(dbgheap.obj) : error LNK2005: \_\_free\_dbg already defined in MSVCRTD.lib(MSVCR90D.dll)  
1\>LIBCMTD.lib(dbgheap.obj) : error LNK2005: \_\_CrtSetCheckCount already defined in MSVCRTD.lib(MSVCR90D.dll)  
1\>LIBCMTD.lib(crt0dat.obj) : error LNK2005: \_exit already defined in MSVCRTD.lib(MSVCR90D.dll)  
1\>LIBCMTD.lib(crt0dat.obj) : error LNK2005: \_\_amsg\_exit already defined in MSVCRTD.lib(MSVCR90D.dll)  
1\>LIBCMTD.lib(crt0dat.obj) : error LNK2005: \_\_initterm\_e already defined in MSVCRTD.lib(MSVCR90D.dll)  
1\>LIBCMTD.lib(fflush.obj) : error LNK2005: \_fflush already defined in MSVCRTD.lib(MSVCR90D.dll)  
1\>LIBCMTD.lib(dbghook.obj) : error LNK2005: \_\_crt\_debugger\_hook already defined in MSVCRTD.lib(MSVCR90D.dll)  
1\>LIBCMTD.lib(tidtable.obj) : error LNK2005: \_\_encode\_pointer already defined in MSVCRTD.lib(MSVCR90D.dll)  
1\>LIBCMTD.lib(tidtable.obj) : error LNK2005: \_\_encoded\_null already defined in MSVCRTD.lib(MSVCR90D.dll)  
1\>LIBCMTD.lib(tidtable.obj) : error LNK2005: \_\_decode\_pointer already defined in MSVCRTD.lib(MSVCR90D.dll)  
1\>LIBCMTD.lib(sprintf.obj) : error LNK2005: \_sprintf already defined in MSVCRTD.lib(MSVCR90D.dll)  
1\>LIBCMTD.lib(invarg.obj) : error LNK2005: \_\_invalid\_parameter already defined in MSVCRTD.lib(MSVCR90D.dll)  
1\>LIBCMTD.lib(crt0init.obj) : error LNK2005: \_\_\_xi\_a already defined in MSVCRTD.lib(cinitexe.obj)  
1\>LIBCMTD.lib(crt0init.obj) : error LNK2005: \_\_\_xi\_z already defined in MSVCRTD.lib(cinitexe.obj)  
1\>LIBCMTD.lib(crt0init.obj) : error LNK2005: \_\_\_xc\_a already defined in MSVCRTD.lib(cinitexe.obj)  
1\>LIBCMTD.lib(crt0init.obj) : error LNK2005: \_\_\_xc\_z already defined in MSVCRTD.lib(cinitexe.obj)  
1\>LIBCMTD.lib(hooks.obj) : error LNK2005: “void \_\_cdecl terminate(void)” (?terminate@@YAXXZ) already defined in MSVCRTD.lib(MSVCR90D.dll)  
1\>LIBCMTD.lib(winxfltr.obj) : error LNK2005: \_\_\_CppXcptFilter already defined in MSVCRTD.lib(MSVCR90D.dll)  
1\>LIBCMTD.lib(mlock.obj) : error LNK2005: \_\_lock already defined in MSVCRTD.lib(MSVCR90D.dll)  
1\>LIBCMTD.lib(mlock.obj) : error LNK2005: \_\_unlock already defined in MSVCRTD.lib(MSVCR90D.dll)  
1\>LIBCMTD.lib(vsprintf.obj) : error LNK2005: \_vsprintf already defined in MSVCRTD.lib(MSVCR90D.dll)  
1\>LIBCMTD.lib(\_ctype.obj) : error LNK2005: \_isspace already defined in MSVCRTD.lib(MSVCR90D.dll)  
1\>LIBCMTD.lib(dbgrptw.obj) : error LNK2005: \_\_CrtDbgReportW already defined in MSVCRTD.lib(MSVCR90D.dll)  
1\>LIBCMTD.lib(printf.obj) : error LNK2005: \_printf already defined in MSVCRTD.lib(MSVCR90D.dll)  
1\>LIBCMTD.lib(getenv.obj) : error LNK2005: \_getenv already defined in MSVCRTD.lib(MSVCR90D.dll)  
1\>LIBCMTD.lib(tolower.obj) : error LNK2005: \_tolower already defined in MSVCRTD.lib(MSVCR90D.dll)  
1\>LIBCMTD.lib(vprintf.obj) : error LNK2005: \_vprintf already defined in MSVCRTD.lib(MSVCR90D.dll)  
  
I tried to ignore libcmtd.lib, but then I get the following errors instead:  
  
1\>pvrtc.lib(tools.obj) : error LNK2019: unresolved external symbol \_\_iob referenced in function \_printf\_flush  
1\>pvrtc.lib(bitmap.obj) : error LNK2001: unresolved external symbol \_\_iob  
1\>pvrtc.lib(amtc.obj) : error LNK2001: unresolved external symbol \_\_iob  
  
I’m guessing these errors are a result of mixing debug and release libraries or libraries compiled w/ another version of Visual Studio.&nbsp; I’m trying to build a debug version of my application, which uses the Multi-threaded Debug DLL, using Visual Studio 2008.  
  
Can someone provide some details about what options were used to create the lib version of pvrtc?&nbsp; Assuming there is an incompatibility, is it possible to get a new library built w/ VS 2008?  
  
Is dll version of pvrtc built w/ the same compiler options as the lib version?&nbsp; I’m a little confused as to why the dll version works while the lib version doesn’t.

---

<div class="post-metadata">

**Author:** ![forestierul](https://avatars.discourse-cdn.com/v4/letter/f/46a35a/32.png) [@forestierul](https://forums.imgtec.com/u/forestierul)\
**Post date:** [January 5, 2011, 11:33pm UTC](https://forums.imgtec.com/t/using-pvrtc-lib/962/2 "2011-01-05T23:33:13Z")

</div>

This happens because you try to link with a runtime different than the pvrtc lib.  
  
  
In MSVC, in project options under C/C++ -\> Code Generation -\> Runtime Library.  
  
  
Try all the values until it works 🙂

---

<div class="post-metadata">

**Author:** ![deep](https://avatars.discourse-cdn.com/v4/letter/d/ce7236/32.png) [@deep](https://forums.imgtec.com/u/deep)\
**Post date:** [January 6, 2011, 8:45pm UTC](https://forums.imgtec.com/t/using-pvrtc-lib/962/3 "2011-01-06T20:45:03Z")

</div>

While that may be informative, I’m working w/ a very large code base that links w/ other 3rd components, so changing the version of the C runtime I use is not an option.  
  
While I understand the desire to not expose the source to the pvrtc library, if you’re going to do that you should ship the SDK w/ several (documented) versions of the library in an effort to&nbsp; maximize the potential that the library could actually be used.  
  
Is it possible to get another build of this library?
