# Newest PVRlib (  "3.23" ), link error

**URL:** <https://forums.imgtec.com/t/newest-pvrlib-3-23-link-error/1397>\
**Category:** PowerVR Insider\
**Created:** [April 24, 2012, 10:55am UTC](https://forums.imgtec.com/t/newest-pvrlib-3-23-link-error/1397 "2012-04-24T10:55:26Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![olivierc](https://avatars.discourse-cdn.com/v4/letter/o/4491bb/32.png) [@olivierc](https://forums.imgtec.com/u/olivierc)\
**Post date:** [April 24, 2012, 10:55am UTC](https://forums.imgtec.com/t/newest-pvrlib-3-23-link-error/1397/1 "2012-04-24T10:55:26Z")

</div>

Just tried to recompile my compression tool, on windows (x86) and linux (x64), using the latest PVRlib ( 3.23 ) got the same link error on windows or linux :  
  
  
  
  
  
  
  
  
2\>main.obj : error LNK2001: unresolved external symbol "\_\_declspec(dllimport) public: char const \* \_\_thiscall PVRException::what(void)const " (\__imp_?what@PVRException@@QBEQBDXZ)  
  
  
2\>main.obj : error LNK2001: unresolved external symbol "\_\_declspec(dllimport) public: unsigned int \_\_thiscall pvrtexlib::CPVRTexture::writeToFile(char const \* const)const " (\__imp_?writeToFile@CPVRTexture@pvrtexlib@@QBEIQBD@Z)  
  
  
2\>main.obj : error LNK2001: unresolved external symbol “\_\_declspec(dllimport) public: class pvrtexlib::CPVRTextureData & \_\_thiscall pvrtexlib::CPVRTexture::getData(void)” (\__imp_?getData@CPVRTexture@pvrtexlib@@QAEAAVCPVRTextureData@2@XZ)  
  
  
2\>main.obj : error LNK2001: unresolved external symbol “\_\_declspec(dllimport) public: class pvrtexlib::CPVRTextureHeader & \_\_thiscall pvrtexlib::CPVRTexture::getHeader(void)” (\__imp_?getHeader@CPVRTexture@pvrtexlib@@QAEAAVCPVRTextureHeader@2@XZ)  
  
  
2\>main.obj : error LNK2001: unresolved external symbol “\_\_declspec(dllimport) public: \_\_thiscall pvrtexlib::CPVRTexture::CPVRTexture(class pvrtexlib::CPVRTextureHeader &,class pvrtexlib::CPVRTextureData &)” (\__imp_??0CPVRTexture@pvrtexlib@@QAE@AAVCPVRTextureHeader@1@AAVCPVRTextureData@1@@Z)  
  
  
2\>main.obj : error LNK2001: unresolved external symbol “\_\_declspec(dllimport) public: \_\_thiscall pvrtexlib::CPVRTexture::CPVRTexture(unsigned int,unsigned int,unsigned int,unsigned int,bool,bool,bool,bool,bool,bool,bool,enum pvrtexlib::PixelType,float,unsigned char \*)” (\__imp_??0CPVRTexture@pvrtexlib@@QAE@IIII\_N000000W4PixelType@1@MPAE@Z)  
  
  
2\>main.obj : error LNK2001: unresolved external symbol “\_\_declspec(dllimport) public: void \_\_thiscall pvrtexlib::PVRTextureUtilities::CompressPVR(class pvrtexlib::CPVRTextureHeader &,class pvrtexlib::CPVRTextureData &,class pvrtexlib::CPVRTextureHeader &,class pvrtexlib::CPVRTextureData &,bool,int)” (\__imp_?CompressPVR@PVRTextureUtilities@pvrtexlib@@QAEXAAVCPVRTextureHeader@2@AAVCPVRTextureData@2@01\_NH@Z)  
  
  
2\>main.obj : error LNK2001: unresolved external symbol “\_\_declspec(dllimport) public: \_\_thiscall pvrtexlib::PVRTextureUtilities::~PVRTextureUtilities(void)” (\__imp_??1PVRTextureUtilities@pvrtexlib@@QAE@XZ)  
  
  
2\>main.obj : error LNK2001: unresolved external symbol “\_\_declspec(dllimport) public: \_\_thiscall pvrtexlib::PVRTextureUtilities::PVRTextureUtilities(void)” (\__imp_??0PVRTextureUtilities@pvrtexlib@@QAE@XZ)  
  
  
2\>main.obj : error LNK2001: unresolved external symbol “\_\_declspec(dllimport) public: void \_\_thiscall pvrtexlib::CPVRTextureHeader::setPixelType(enum pvrtexlib::PixelType)” (\__imp_?setPixelType@CPVRTextureHeader@pvrtexlib@@QAEXW4PixelType@2@@Z)  
  
  
2\>main.obj : error LNK2001: unresolved external symbol "\_\_declspec(dllimport) public: unsigned int \_\_thiscall pvrtexlib::CPVRTextureData::getDataSize(void)const " (\__imp_?getDataSize@CPVRTextureData@pvrtexlib@@QBEIXZ)  
  
  
2\>main.obj : error LNK2001: unresolved external symbol "\_\_declspec(dllimport) public: unsigned char \* \_\_thiscall pvrtexlib::CPVRTextureData::getData(void)const " (\__imp_?getData@CPVRTextureData@pvrtexlib@@QBEPAEXZ)  
  
  
2\>main.obj : error LNK2001: unresolved external symbol “\_\_declspec(dllimport) public: \_\_thiscall pvrtexlib::CPVRTextureData::~CPVRTextureData(void)” (\__imp_??1CPVRTextureData@pvrtexlib@@QAE@XZ)  
  
  
2\>main.obj : error LNK2001: unresolved external symbol “\_\_declspec(dllimport) public: \_\_thiscall pvrtexlib::CPVRTextureData::CPVRTextureData(void)” (\__imp_??0CPVRTextureData@pvrtexlib@@QAE@XZ)  
  
  
2\>main.obj : error LNK2001: unresolved external symbol “\_\_declspec(dllimport) public: \_\_thiscall pvrtexlib::CPVRTextureData::CPVRTextureData(class pvrtexlib::CPVRTextureData const &)” (\__imp_??0CPVRTextureData@pvrtexlib@@QAE@ABV01@@Z)  
  
  
2\>main.obj : error LNK2001: unresolved external symbol “\_\_declspec(dllimport) public: \_\_thiscall pvrtexlib::CPVRTexture::~CPVRTexture(void)” (\__imp_??1CPVRTexture@pvrtexlib@@QAE@XZ)  
  
  
  
  
  
Any idea ?

---

<div class="post-metadata">

**Author:** ![tobias](https://avatars.discourse-cdn.com/v4/letter/t/c67d28/32.png) [@tobias](https://forums.imgtec.com/u/tobias)\
**Post date:** [April 24, 2012, 1:34pm UTC](https://forums.imgtec.com/t/newest-pvrlib-3-23-link-error/1397/2 "2012-04-24T13:34:15Z")

</div>

Hi olivier,  
  
The latest version of the library is now v4.02 - v3.23 is the last update of the previous major revision, and the API has been updated since this version. The linker errors that you’re having are referring to v3 functions that no longer exist in v4. Are you using the new headers as well as the new library?  
  
The new library uses a new namespace - “pvrtexture::” rather than “pvrtexlib::” to help identify where you need to update your code. It’s worth looking at these issues, and having a read through of the new manual that comes with the library. If you need any help porting over from the old version to the new one please don’t hesitate to ask.  
  
Thanks,  
  
Tobias

---

<div class="post-metadata">

**Author:** ![olivierc](https://avatars.discourse-cdn.com/v4/letter/o/4491bb/32.png) [@olivierc](https://forums.imgtec.com/u/olivierc)\
**Post date:** [April 24, 2012, 4:51pm UTC](https://forums.imgtec.com/t/newest-pvrlib-3-23-link-error/1397/3 "2012-04-24T16:51:37Z")

</div>

Make sense 🙂 I just unzipped the update to the folder that was containing the old version, so the previous header were not deleted. Guess Im good for a rewrite of my tool :(.

---

<div class="post-metadata">

**Author:** ![olivierc](https://avatars.discourse-cdn.com/v4/letter/o/4491bb/32.png) [@olivierc](https://forums.imgtec.com/u/olivierc)\
**Post date:** [April 25, 2012, 7:46am UTC](https://forums.imgtec.com/t/newest-pvrlib-3-23-link-error/1397/4 "2012-04-25T07:46:55Z")

</div>

Ok, I converted my tool to the new PVR library API, a now I have these link error :  
  
  
  
  
  
2\> All outputs are up-to-date.  
  
  
2\>main.obj : error LNK2019: unresolved external symbol “public: virtual \_\_thiscall CPVRTString::~CPVRTString(void)” (??1CPVRTString@@UAE@XZ) referenced in function “bool \_\_cdecl compressBitmap(class Foundation::Bitmap &,class Foundation::Bitmap &,struct Options const &,class std::basic\_string\<char,struct std::char\_traits\<char\>,class std::allocator\<char\> \> const &,int)” (?compressBitmap@@YA\_NAAVBitmap@Foundation@@0ABUOptions@@ABV?$basic\_string@DU?$char\_traits@D@std@@V?$allocator@D@2@@std@@H@Z)  
  
  
2\>main.obj : error LNK2019: unresolved external symbol “public: \_\_thiscall CPVRTString::CPVRTString(char const \*,unsigned int)” (??0CPVRTString@@QAE@PBDI@Z) referenced in function “bool \_\_cdecl compressBitmap(class Foundation::Bitmap &,class Foundation::Bitmap &,struct Options const &,class std::basic\_string\<char,struct std::char\_traits\<char\>,class std::allocator\<char\> \> const &,int)” (?compressBitmap@@YA\_NAAVBitmap@Foundation@@0ABUOptions@@ABV?$basic\_string@DU?$char\_traits@D@std@@V?$allocator@D@2@@std@@H@Z)  
  
  
2\>main.obj : error LNK2001: unresolved external symbol “public: static unsigned int const CPVRTString::npos” (?npos@CPVRTString@@2IB)  
  
  
2\>D:mMapPlatformsWindows…/…/BuildmCompress.Debug.Win32.exe : fatal error LNK1120: 3 unresolved externals  
  
  
  
  
  
Any idea ?  
  
  
Thanks in advance.

---

<div class="post-metadata">

**Author:** ![tobias](https://avatars.discourse-cdn.com/v4/letter/t/c67d28/32.png) [@tobias](https://forums.imgtec.com/u/tobias)\
**Post date:** [April 25, 2012, 7:58am UTC](https://forums.imgtec.com/t/newest-pvrlib-3-23-link-error/1397/5 "2012-04-25T07:58:18Z")

</div>

Hi Olivier,  
  
This is odd, are you using the lib or dll? It should be exposed in each - although looking at the code, the dll may not be exposing it correctly… If this is the case then a simple workaround is to grab “PVRTString.cpp” from our latest SDK and compile it into your project. If you’re using the .lib then this is a more serious problem which I’ll need to look into - though the same workaround should apply.  
  
Thanks,  
  
Tobias

---

<div class="post-metadata">

**Author:** ![olivierc](https://avatars.discourse-cdn.com/v4/letter/o/4491bb/32.png) [@olivierc](https://forums.imgtec.com/u/olivierc)\
**Post date:** [April 25, 2012, 8:57am UTC](https://forums.imgtec.com/t/newest-pvrlib-3-23-link-error/1397/6 "2012-04-25T08:57:10Z")

</div>

I’m using the DLL version so it might be that. I will try your fix.

---

<div class="post-metadata">

**Author:** ![olivierc](https://avatars.discourse-cdn.com/v4/letter/o/4491bb/32.png) [@olivierc](https://forums.imgtec.com/u/olivierc)\
**Post date:** [May 10, 2012, 10:59am UTC](https://forums.imgtec.com/t/newest-pvrlib-3-23-link-error/1397/7 "2012-05-10T10:59:11Z")

</div>

Ok, so now it compiles. &nbsp;But the transcode function fails, and it did not displays any error message ( from the PVRError include, &nbsp;the lib displays error only in debug build, which your are not providing). I really think that having some feedback over what’s going on is important, any idea how to do that ?

  

This the code I’m using to convert my data :

  

&nbsp; &nbsp; bool hasAlpha = source.getBPP() \> 24;

&nbsp; &nbsp; if (options.compression == Foundation::Bitmap::ETC1)&nbsp;

&nbsp; &nbsp; &nbsp; &nbsp; hasAlpha = false;

&nbsp; &nbsp;&nbsp;

&nbsp; &nbsp; pvrtexture::CPVRTextureHeader sOriginalTextureHeader(ePVRTPF\_RGBG8888,

&nbsp; &nbsp; &nbsp; &nbsp; source.getWidth(), // u32Width,

&nbsp; &nbsp; &nbsp; &nbsp; source.getHeight());

  

&nbsp; &nbsp; source.fromRGBToRGBA();

  

&nbsp; &nbsp; pvrtexture::CPVRTextureHeader sSourceHeader(sOriginalTextureHeader);

&nbsp; &nbsp; pvrtexture::CPVRTexture &nbsp; &nbsp; &nbsp; sSource(sSourceHeader, source.getData());

&nbsp; &nbsp; pvrtexture::PixelType &nbsp; &nbsp; &nbsp; &nbsp; pvrLibCompression;

  

&nbsp; &nbsp; Foundation::Bitmap::Type compression = options.compression;

&nbsp; &nbsp; if (options.compression == Foundation::Bitmap::PVR2)

&nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; &nbsp;

&nbsp; &nbsp; &nbsp; &nbsp; if (hasAlpha)

&nbsp; &nbsp; &nbsp; &nbsp; {

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pvrLibCompression = ePVRTPF\_PVRTCI\_2bpp\_RGBA;

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; compression = Foundation::Bitmap::PVR2ALPHA;

&nbsp; &nbsp; &nbsp; &nbsp; }

&nbsp; &nbsp; &nbsp; &nbsp; else

&nbsp; &nbsp; &nbsp; &nbsp; {

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pvrLibCompression = ePVRTPF\_PVRTCI\_2bpp\_RGB;

&nbsp; &nbsp; &nbsp; &nbsp; }

&nbsp; &nbsp; }

&nbsp; &nbsp; else if (options.compression == Foundation::Bitmap::ETC1)&nbsp;

&nbsp; &nbsp; {

&nbsp; &nbsp; &nbsp; &nbsp; pvrLibCompression = ePVRTPF\_ETC1;

&nbsp; &nbsp; }

&nbsp; &nbsp; else if (options.compression == Foundation::Bitmap::S3)&nbsp;

&nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; &nbsp;

#if !defined(LINUX)

&nbsp; &nbsp; &nbsp; &nbsp; pvrLibCompression = ePVRTPF\_DXT1;

&nbsp; &nbsp; &nbsp; &nbsp; if (hasAlpha)

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; compression = Foundation::Bitmap::S3ALPHA;

#endif

&nbsp; &nbsp; }

&nbsp; &nbsp; else

&nbsp; &nbsp; {

&nbsp; &nbsp; &nbsp; &nbsp; if (hasAlpha)

&nbsp; &nbsp; &nbsp; &nbsp; {

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pvrLibCompression = ePVRTPF\_PVRTCI\_4bpp\_RGBA;

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; compression = Foundation::Bitmap::PVR4ALPHA;

&nbsp; &nbsp; &nbsp; &nbsp; }

&nbsp; &nbsp; &nbsp; &nbsp; else

&nbsp; &nbsp; &nbsp; &nbsp; {

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pvrLibCompression = ePVRTPF\_PVRTCI\_4bpp\_RGB;

&nbsp; &nbsp; &nbsp; &nbsp; }

&nbsp; &nbsp; }

  

&nbsp; &nbsp; destination.create(source.getWidth(), source.getHeight(), compression);

  

&nbsp; &nbsp; if (!pvrtexture::Transcode(sSource, pvrLibCompression, ePVRTVarTypeUnsignedByte, ePVRTCSpacelRGB, pvrtexture::ePVRTCBest))

&nbsp; &nbsp; { &nbsp; &nbsp; &nbsp; &nbsp;

&nbsp; &nbsp; &nbsp; &nbsp; return false; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;

&nbsp; &nbsp; }

  

&nbsp; &nbsp; memcpy(destination.getData(), sSource.getDataPtr(), sSource.getDataSize()); &nbsp; &nbsp;

&nbsp; &nbsp; if (options.outputCompressTextureFile)

&nbsp; &nbsp; {

  

&nbsp; &nbsp; &nbsp; &nbsp; std::stringstream outputFileName;

&nbsp; &nbsp; &nbsp; &nbsp; outputFileName \<\< input \<\< “\_” \<\< textureIndex \<\< “.pvr”;

&nbsp; &nbsp; &nbsp; &nbsp; sSource.saveFile(outputFileName.str().c\_str());

&nbsp; &nbsp; }

  

&nbsp; &nbsp; return true;

---

<div class="post-metadata">

**Author:** ![tobias](https://avatars.discourse-cdn.com/v4/letter/t/c67d28/32.png) [@tobias](https://forums.imgtec.com/u/tobias)\
**Post date:** [May 10, 2012, 11:41am UTC](https://forums.imgtec.com/t/newest-pvrlib-3-23-link-error/1397/8 "2012-05-10T11:41:39Z")

</div>

Hi Olivier,  
  
PVRError is included only due to a slightly irritating dependency chain which I plan to remove at some point - it has no direct interaction with the library.  
  
The error you're having appears to come from your initial set up, you've used "ePVRTPF\_RGBG8888" which is currently not supported by the library, and is probably not the format you were trying to use. RGBG8888 is actually a compressed format which stores a pair of pixels in every 32-bits - it stores two instances of the green channel for this reason. The enum values in that list only refer to compressed formats, anything else is done dynamically.  
  
The format you actually want to use is RGBA8888 I assume? In which case you can use "PVRStandard8PixelType" which is a constant value stored in PVRTextureFormat.h. Any other formats you require should be generated using either the PixelType union also in PVRTextureFormat.h, or the PVRTGENPIXELIDn macros in PVRTTexture.h. Either of these will allow you to generate format identifiers for uncompressed formats. For further information on these I suggest you read through the PVRTexLib manual which goes into slightly more detail.  
  
Currently the only error handling is via the boolean value that pops out as the return value of the function, proper error handling is something that is planned to be added later.  
  
Thanks,  
  
Tobias  
  
  
  
  
Tobias2012-05-10 13:42:52

---

<div class="post-metadata">

**Author:** ![olivierc](https://avatars.discourse-cdn.com/v4/letter/o/4491bb/32.png) [@olivierc](https://forums.imgtec.com/u/olivierc)\
**Post date:** [May 10, 2012, 1:29pm UTC](https://forums.imgtec.com/t/newest-pvrlib-3-23-link-error/1397/9 "2012-05-10T13:29:28Z")

</div>

Thanks it seems to work now :). It’s not really clear in the documentation ( or my brain is maybe not able to process it 🙂 ).

anyway I did that :

  

&nbsp; &nbsp; pvrtexture::CPVRTextureHeader sOriginalTextureHeader(pvrtexture::PVRStandard8PixelType.PixelTypeID,

&nbsp; &nbsp; &nbsp; &nbsp; source.getWidth(), // u32Width,

&nbsp; &nbsp; &nbsp; &nbsp; source.getHeight());

---

<div class="post-metadata">

**Author:** ![sendel](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.imgtec.com/sendel/32/202_2.png) [@sendel](https://forums.imgtec.com/u/sendel)\
**Post date:** [July 16, 2013, 11:27am UTC](https://forums.imgtec.com/t/newest-pvrlib-3-23-link-error/1397/10 "2013-07-16T11:27:42Z")

</div>

Hi, I ran into somekind of the same issue using the SDK 3.1 and the method “texture.setCubemapOrder(”")".  
  
  
  
Trying to add PVRTString.cpp will compile well, but executing the code crashes inside the destructor of CPVRTString. I think this could be a problem with Runtime Libraries I use in my projects and you use in your dll. (E.g. dynamic multi threaded library vs static single threaded library)  
  
  
  
Since this seems to be a serios issue, I hope your team already submitted a fixed version? And where would I get this version? 😉  
  
  
  
UPDATE 1: I found out that there is a SDK3.2 Update 1&2 on the imagination site - I am downloading it and hopefully its fixed then 😉  
  
  
  
UPDATE2 : nah! Still got the same errors, even with the latest version: ““public: \_\_thiscall CPVRTString::CPVRTString(char const \*,unsigned int)” (??0CPVRTString@@QAE@PBDI@Z)” in Funktion "“bool \_\_cdecl CompressTextureData(unsigned char \*,int,int,enum AE3::Texture::AEI\_Format,int,unsigned int,char,bool,enum TargetConfigurations::TargetConfiguration::eTextureCompressionQuality,class pvrtexture::CPVRTexture &,class ILog \*)” (?CompressTextureData@@YA\_NPAEHHW4AEI\_Format@Texture@AE3@@HID\_NW4eTextureCompressionQuality@TargetConfiguration@TargetConfigurations@@AAVCPVRTexture@pvrtexture@@PAVILog@@@Z)"  
  
  
  
UPDATE3: **SOLVED !!!** You have to check what kind of runtime codegeneration you have. In my project it was set to “Multi Threaded Debug /MTd” - so you I had to use the static version of PVRTexLib - not the dynamic (dll).
