I’m trying to compress from uncompressed RGBA to pvrtc2b (no mipmap) using VC2010.
2>Base.obj : error LNK2001: unresolved external symbol “public: virtual __thiscall CPVRTString::~CPVRTString(void)” (??1CPVRTString@@UAE@XZ)
2>Base.obj : error LNK2001: unresolved external symbol “public: __thiscall CPVRTString::CPVRTString(char const *,unsigned int)” (??0CPVRTString@@QAE@PBDI@Z)
2>Base.obj : error LNK2001: unresolved external symbol “public: static unsigned int const CPVRTString::npos” (?npos@CPVRTString@@2IB)
if the cTexture.saveFile(…) function is commented it’s all fine… any idea?
(linked against dynamic version of PVRTexLib)
some code below:
#define _WINDLL_IMPORT 1
using namespace pvrtexlib;
using namespace pvrtexture;
pvrHeader.u32Version = PVRTEX_CURR_IDENT;
pvrHeader.u32Flags = 0;
pvrHeader.u64PixelFormat = PVRStandard8PixelType.PixelTypeID;
pvrHeader.u32ColourSpace = ePVRTCSpacelRGB;
pvrHeader.u32ChannelType = ePVRTVarTypeUnsignedByte;
pvrHeader.u32Height = newImageWidth;
pvrHeader.u32Width = newImageWidth;
pvrHeader.u32Depth = 1;
pvrHeader.u32NumSurfaces = 1;
pvrHeader.u32NumFaces = 1;
pvrHeader.u32MIPMapCount = 1;
pvrHeader.u32MetaDataSize = 0;
// Create the image.
CPVRTexture cTexture(pvrHeader, pRaw);
// Compress to PVRTC 4bpp.
PixelType PVRTC2BPP (ePVRTPF_PVRTCI_2bpp_RGB);
Transcode(cTexture, PVRTC2BPP, ePVRTVarTypeUnsignedInteger, ePVRTCSpacelRGB);
// Save the file
Two things that immediately spring to mind:
Firstly, are you also including the tools library in your code? This usually crops up if there are two versions of CPVRTString being included in a project.
Secondly, along similar lines, are you definitely using the PVRTString.h that was included with the 4.3 library? Any other versions of the header will also break linking in the manner you’ve described above.
I’m only using PVRTexLib.lib (dll version) and headers provided with the latest SDK version -> ( ImaginationPowerVRGraphicsSDKPVRTexToolLibraryInclude )
Any other idea?
Ah… yep I’ve figured out the issue.
So in “PVRTextureDefines.h” there are a number of forward declarations for various classes, so that they get exposed in the Windows dll. Unfortunately it appears I missed off CPVRTString from this list, so it’s not being exposed properly.
You can get around this by including CPVRTString.cpp in your project from the tools folder of the same release. I’ve fixed this for our 3.1 release as well.
Sorry for the inconvenience!
There is no such a file into SDK 3.0 .
Where is it located exactly ?
anyone got CPVRTString.cpp ?
The file is part of the PVRTools package, you’ll need to download it from the installer if you haven’t already.
Hi, I have the same issue here using the SDK 3.1 from the GDC.
Have tried to add PVRTString.cpp. It compiles well, but the usage of CPVRTString crashes inside the destructor of CPVRTString. I think this could be due to Runtime-Library inconsistency. [for example Multithreaded Debug DLL vs Static Singlethreaded DLL]
I tried to use the method texture.setCubeMapOrder(“ZzXxYy”); But this will resolve in either in a “unresolved symbol CPVRTString” or [when including the PVRTString.cpp] in a crash inside "~CPVRTString()"
Where could I get the fixed SDK3.1 you are talking about?
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).
Ah.. yep I've figured out the issue.
So in "PVRTextureDefines.h" there are a number of forward declarations for various classes, so that they get exposed in the Windows dll. Unfortunately it appears I missed off CPVRTString from this list, so it's not being exposed properly.
You can get around this by including CPVRTString.cpp in your project from the tools folder of the same release. I've fixed this for our 3.1 release as well.
Sorry for the inconvenience!
So guess its still not fixed on version 3.1 as I get the same issue?
I have to add PVRTString.cpp to my project or use the static version.
Error 320 error LNK2019: unresolved external symbol "public: virtual __thiscall CPVRTString::~CPVRTString(void)" (??
Error 321 error LNK2019: unresolved external symbol "public: __thiscall CPVRTString::CPVRTString(char const
Error 322 error LNK2001: unresolved external symbol "public: static unsigned int const CPVRTString::npos" (?
That’s… odd. I definitely added that for the 3.1 release… could I ask which version of the SDK you’re using so that I can investigate? Maybe the problem is a little deeper than I realised?
Details on how I can get you more detailed version information?
All I see is SDK version 3.1
PVRTexLib.dll itself reads as File version 22.214.171.124
The file version is fine - there’s also a header included - “PVRTextureVersion.h” which has the same information.
This is in fact the most up to date version, so I’ll have to try it again and see if I can replicate your issue.
Ok you’re right, it was still broken. No idea how it worked for me when I tested it before… I’ve fixed this now, but I’m afraid it’s unlikely to make our 3.2 release at this point as it’s in the final stages of testing. I’ll update PVRTexLib at some point with the updated version.
As you mentioned above, the workaround is to include CPVRTString.cpp directly. This shouldn’t be a problem in future versions of the SDK. Thanks for letting me know!