# Errors when starting new project

**URL:** <https://forums.imgtec.com/t/errors-when-starting-new-project/1710>\
**Category:** PowerVR Insider\
**Created:** [March 18, 2013, 11:44am UTC](https://forums.imgtec.com/t/errors-when-starting-new-project/1710 "2013-03-18T11:44:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![john-lam](https://avatars.discourse-cdn.com/v4/letter/j/f475e1/32.png) [@john-lam](https://forums.imgtec.com/u/john-lam)\
**Post date:** [March 18, 2013, 11:44am UTC](https://forums.imgtec.com/t/errors-when-starting-new-project/1710/1 "2013-03-18T11:44:15Z")

</div>

Hi all,  
  
  
  
I have included all files necessary including all the EGL, GLES2, and GLES headers etc… however at the moment I am getting an error and one warning  
  
  
  
Error 2 error C2731: ‘WinMain’ : function cannot be overloaded c:usersxdocumentsvisual studio 2010projectsogles2\_pvrogles2\_pvrpvrshellos.cpp 764 1 OGLES2\_PVR  
  
  
  
and  
  
  
  
Error 3 error C2065: ‘PVRSDK\_VERSION’ : undeclared identifier c:usersxdocumentsvisual studio 2010projectsogles2\_pvrogles2\_pvrpvrshell.cpp 539 1 OGLES2\_PVR  
  
  
  
Warning 1 warning C4996: ‘\_vsnprintf’: This function or variable may be unsafe. Consider using \_vsnprintf\_s instead. To disable deprecation, use \_CRT\_SECURE\_NO\_WARNINGS. See online help for details. c:usersxdocumentsvisual studio 2010projectsogles2\_pvrogles2\_pvrpvrshellos.cpp 79 1 OGLES2\_PVR

---

<div class="post-metadata">

**Author:** ![Scott](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.imgtec.com/scott/32/256_2.png) [@Scott](https://forums.imgtec.com/u/Scott)\
**Post date:** [March 19, 2013, 8:40am UTC](https://forums.imgtec.com/t/errors-when-starting-new-project/1710/2 "2013-03-19T08:40:56Z")

</div>

Hi,  
  
  
  
I believe the WinMain error is due to your project’s “Character Set” being set to “Use Unicode Character Set”. If you set this to “Use Multi-Byte Character Set” under the General Configuration Properties the error should go away.  
  
  
  
As for the second error, PVRSDK\_VERSION is defined in sdkver.h. However, I’m assuming this header can be found otherwise you’d get a different error. Also, if sdkver.h wasn’t defining it then PVRShell.cpp defines it. Has PVRShell.cpp been modified to not include sdkver.h or define PVRSDK\_VERSION?  
  
  
  
Thanks,  
  
  
  
Scott

---

<div class="post-metadata">

**Author:** ![john-lam](https://avatars.discourse-cdn.com/v4/letter/j/f475e1/32.png) [@john-lam](https://forums.imgtec.com/u/john-lam)\
**Post date:** [March 19, 2013, 9:10am UTC](https://forums.imgtec.com/t/errors-when-starting-new-project/1710/3 "2013-03-19T09:10:10Z")

</div>

Hi Scott,  
  
  
  
I have solved the PVRSDK\_VERSION problem and carried out as you instructed with the WinMain error. This got rid of the error but then came back with many linker errors. I have already went into VS configuration properties and included the directories needed. Here is one of the errors  
  
  
  
Error 1 error LNK2019: unresolved external symbol “class PVRShell \* \_\_cdecl NewDemo(void)” (?NewDemo@@YAPAVPVRShell@@XZ) referenced in function “public: bool \_\_thiscall PVRShellInit::Init(void)” (?Init@PVRShellInit@@QAE\_NXZ) C:UsersjohnDocumentsVisual Studio 2010ProjectsOGLES2\_PVR\_WATEROGLES2\_PVR\_WATERPVRShell.obj OGLES2\_PVR\_WATER  
  
  
  
Most of the errors are occuring within the PVRShellAPI.Obj

---

<div class="post-metadata">

**Author:** ![Scott](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.imgtec.com/scott/32/256_2.png) [@Scott](https://forums.imgtec.com/u/Scott)\
**Post date:** [March 19, 2013, 3:35pm UTC](https://forums.imgtec.com/t/errors-when-starting-new-project/1710/4 "2013-03-19T15:35:42Z")

</div>

> Error 1 error LNK2019: unresolved external symbol "class PVRShell \* \_\_cdecl NewDemo(void)" (?NewDemo@@YAPAVPVRShell@@XZ) referenced in function "public: bool \_\_thiscall PVRShellInit::Init(void)" (?Init@PVRShellInit@@QAE\_NXZ) C:UsersjohnDocumentsVisual Studio 2010ProjectsOGLES2\_PVR\_WATEROGLES2\_PVR\_WATERPVRShell.obj OGLES2\_PVR\_WATER

  
  
You need to implement the NewDemo function. This function should return a pointer to the class that inherits from PVRShell. If you take a look at our examples it looks something like  
  
PVRShell\* NewDemo()  
{  
return new OGLES2FilmTV();  
}  
  

> Most of the errors are occuring within the PVRShellAPI.Obj

  
If PVRShellAPI.obj is outputting most of the linking errors I'd guess you aren't linking against libEGL, without seeing the errors I can't be sure though.

---

<div class="post-metadata">

**Author:** ![john-lam](https://avatars.discourse-cdn.com/v4/letter/j/f475e1/32.png) [@john-lam](https://forums.imgtec.com/u/john-lam)\
**Post date:** [March 19, 2013, 6:57pm UTC](https://forums.imgtec.com/t/errors-when-starting-new-project/1710/5 "2013-03-19T18:57:28Z")

</div>

Is it possible if you can give me a run down on how to link the libEGL , as I believe this is the problem  
  
  
  
Here are some of the errors I am encountering:  
  
  
  
Error 21 error LNK2019: unresolved external symbol \_\_imp\_\_eglWaitGL@0 referenced in function “public: void \_\_thiscall PVRShellInit::ApiRenderComplete(void)” (?ApiRenderComplete@PVRShellInit@@QAEXXZ) C:UsersjohnDocumentsVisual Studio 2010ProjectsOGLES2\_PVR\_WATEROGLES2\_PVR\_WATERPVRShellAPI.obj OGLES2\_PVR\_WATER  
  
  
  
Error 20 error LNK2019: unresolved external symbol \_\_imp\_\_glGetError@0 referenced in function “public: bool \_\_thiscall PVRShellInit::ApiScreenCaptureBuffer(int,int,unsigned char \*)” (?ApiScreenCaptureBuffer@PVRShellInit@@QAE\_NHHPAE@Z) C:UsersjohnDocumentsVisual Studio 2010ProjectsOGLES2\_PVR\_WATEROGLES2\_PVR\_WATERPVRShellAPI.obj OGLES2\_PVR\_WATER  
  
  
  
Error 14 error LNK2019: unresolved external symbol \_\_imp\_\_glGetString@4 referenced in function “public: void \_\_thiscall PVRShellInit::OutputAPIInfo(void)” (?OutputAPIInfo@PVRShellInit@@QAEXXZ) C:UsersjohnDocumentsVisual Studio 2010ProjectsOGLES2\_PVR\_WATEROGLES2\_PVR\_WATERPVRShellAPI.obj OGLES2\_PVR\_WATER  
  
  
  
Error 19 error LNK2019: unresolved external symbol \_\_imp\_\_glReadPixels@28 referenced in function “public: bool \_\_thiscall PVRShellInit::ApiScreenCaptureBuffer(int,int,unsigned char \*)” (?ApiScreenCaptureBuffer@PVRShellInit@@QAE\_NHHPAE@Z) C:UsersjohnDocumentsVisual Studio 2010ProjectsOGLES2\_PVR\_WATEROGLES2\_PVR\_WATERPVRShellAPI.obj OGLES2\_PVR\_WATER  
  
  
  
Error 22 error LNK2019: unresolved external symbol \_main referenced in function \_\_\_tmainCRTStartup C:UsersjohnDocumentsVisual Studio 2010ProjectsOGLES2\_PVR\_WATEROGLES2\_PVR\_WATERMSVCRTD.lib(crtexe.obj) OGLES2\_PVR\_WATER  
  
  
  
Thanks,  
  
John
