Imagination PowerVR SDK Blog

Cant compile when referencing OGLES2Tools.h


#1

When I try to compile my project it fails at the linking stage with the following errors:





1>main.obj : error LNK2019: unresolved external symbol “public: virtual __thiscall CPVRTString::~CPVRTString(void)” (??1CPVRTString@@UAE@XZ) referenced in function “public: __thiscall SPVRTPFXParserEffectTexture::~SPVRTPFXParserEffectTexture(void)” (??1SPVRTPFXParserEffectTexture@@QAE@XZ)





1>main.obj : error LNK2019: unresolved external symbol "public: struct PVRTMat4 __thiscall PVRTMat4::operator*(struct PVRTMat4 const &)const " (??DPVRTMat4@@QBE?AU0@ABU0@@Z) referenced in function “void __cdecl Draw(struct ESContext *)” (?Draw@@YAXPAUESContext@@@Z)





1>main.obj : error LNK2019: unresolved external symbol “public: static struct PVRTMat4 __cdecl PVRTMat4::RotationX(float)” (?RotationX@PVRTMat4@@SA?AU1@M@Z) referenced in function “void __cdecl Draw(struct ESContext *)” (?Draw@@YAXPAUESContext@@@Z)





I can see it’s got something to do with the fact that I’m using the matrix math functions, but I’m not clear on why it’s failing. I have OGLES2Tools.lib in my lib folder. I’ve set up my VC++ directories in Visual Studio 2008 to point at the directory with all the PowerVR SDK headers. It seems to be reading the headers fine cause intellisense is working.





Any suggestions?


#2

There are source files available in Tools subdirectory. So, why don’t you just include all these files to you project instead of using library?


#3

I thought the whole point of a library was so you didn’t have to include 70 files in your project.


#4



Hi,

It looks like you're missing OGLES2Tools.lib from the projects additional dependencies.

Thanks,

Scott


#5

Thanks Scott! That was the problem. Sometimes I forget that in addition to adding the #include I have to add the lib.





However, now I’m getting a new linker error.





fatal error C1900: Il mismatch between ‘P1’ version ‘20080116’ and ‘P2’ version '20070207’


LINK : fatal error LNK1257: code generation failed





Does this have something to do with needing Service Pack 1 for VS2008?Legion2012-04-02 18:47:18


#6

Ok, I downloaded SP1 and everything builds now, so that’s good. But I do get a series of linker warnings. Not sure if these matter or not.





OGLES2Tools.lib(PVRTMatrixF.obj) : warning LNK4099: PDB ‘vc90.pdb’ was not found with ‘G:Visual Studio 2008Visual Studio 2008 ProjectsLearningOpenGLLearningOpenGLlibOGLES2Tools.lib’ or at ‘G:Visual Studio 2008Visual Studio 2008 ProjectsLearningOpenGLDebugvc90.pdb’; linking object as if no debug info





OGLES2Tools.lib(PVRTVector.obj) : warning LNK4099: PDB ‘vc90.pdb’ was not found with ‘G:Visual Studio 2008Visual Studio 2008 ProjectsLearningOpenGLLearningOpenGLlibOGLES2Tools.lib’ or at ‘G:Visual Studio 2008Visual Studio 2008 ProjectsLearningOpenGLDebugvc90.pdb’; linking object as if no debug info





OGLES2Tools.lib(PVRTString.obj) : warning LNK4099: PDB ‘vc90.pdb’ was not found with ‘G:Visual Studio 2008Visual Studio 2008 ProjectsLearningOpenGLLearningOpenGLlibOGLES2Tools.lib’ or at ‘G:Visual Studio 2008Visual Studio 2008 ProjectsLearningOpenGLDebugvc90.pdb’; linking object as if no debug info





OGLES2Tools.lib(PVRTResourceFile.obj) : warning LNK4099: PDB ‘vc90.pdb’ was not found with ‘G:Visual Studio 2008Visual Studio 2008 ProjectsLearningOpenGLLearningOpenGLlibOGLES2Tools.lib’ or at ‘G:Visual Studio 2008Visual Studio 2008 ProjectsLearningOpenGLDebugvc90.pdb’; linking object as if no debug info





OGLES2Tools.lib(PVRTPFXParser.obj) : warning LNK4099: PDB ‘vc90.pdb’ was not found with ‘G:Visual Studio 2008Visual Studio 2008 ProjectsLearningOpenGLLearningOpenGLlibOGLES2Tools.lib’ or at ‘G:Visual Studio 2008Visual Studio 2008 ProjectsLearningOpenGLDebugvc90.pdb’; linking object as if no debug info


#7

I tried copying the vc90.pdb file into the Debug directory but that just replaced the previous warnings with:





OGLES2Tools.lib(PVRTResourceFile.obj) : warning LNK4204: ‘G:Visual Studio 2008Visual Studio 2008 ProjectsLearningOpenGLDebugvc90.pdb’ is missing debugging information for referencing module; linking object as if no debug info





OGLES2Tools.lib(PVRTPFXParser.obj) : warning LNK4204: ‘G:Visual Studio 2008Visual Studio 2008 ProjectsLearningOpenGLDebugvc90.pdb’ is missing debugging information for referencing module; linking object as if no debug info





OGLES2Tools.lib(PVRTMatrixF.obj) : warning LNK4204: ‘G:Visual Studio 2008Visual Studio 2008 ProjectsLearningOpenGLDebugvc90.pdb’ is missing debugging information for referencing module; linking object as if no debug info





OGLES2Tools.lib(PVRTVector.obj) : warning LNK4204: ‘G:Visual Studio 2008Visual Studio 2008 ProjectsLearningOpenGLDebugvc90.pdb’ is missing debugging information for referencing module; linking object as if no debug info





OGLES2Tools.lib(PVRTString.obj) : warning LNK4204: ‘G:Visual Studio 2008Visual Studio 2008 ProjectsLearningOpenGLDebugvc90.pdb’ is missing debugging information for referencing module; linking object as if no debug info


#8
Legion wrote:
I thought the whole point of a library was so you didn't have to include 70 files in your project.



It will be compiled only once (ofcourse if you won't modify it in future), but you'll able to see what happens inside when you will debug your code...