Compile PVRTModelPOD / PowerVR SDK with Xcode

Apprentice
Posts: 5
Joined: 2009.05
Post: #1
Hello !
I'm having some troubles using the PowerVR SDK with my iPhone app!
I have downloaded the last SDK two days ago, imported all the files (cpp and h) needed in PVRTModelPOD.cpp/h in my iPhone opengles 2.2.1 project.
When i compile i get tons of errors! like this one :
Code:
Line Location PVRTGlobal.h:158: error: syntax error before '<' token
Code:
template <typename T>
inline void PVRTswap(T& a, T& b)
{
    T temp = a;
    a = b;
    b = temp;
}
In the PVRTGlobal.h file.
This seems to be correct c++ for me , and i'm sure it can compile without any modification...
Is there any flags to set in the project properties to activate some form of c++ ?

Thanks for your help!
Quote this message in a reply
Member
Posts: 166
Joined: 2009.04
Post: #2
Which SDK was that ? Linux ?

I had no problem compiling it pretty much out of the box.
Quote this message in a reply
Apprentice
Posts: 5
Joined: 2009.05
Post: #3
Hi warmi, thanks for the reply !
Yes this is with the linux version of the sdk.
Do you think i should retry with the msi/windows version ?
Quote this message in a reply
Member
Posts: 22
Joined: 2006.04
Post: #4
This may not be the problem, but I think you might want to check that you're not including the file from an Obj-C source file (.m). Templates are C++ not C and the normal Obj-C (or any C) compiler won't understand them. If you find a .m file including PVRTGlobal.h either remove the include or rename the file to .mm so that XCode will use Obj-C++ instead.

IIRC I think I ended up renaming all my .m files to .mm just to avoid this problem coming up again. I think it's also possible to force XCode to compile all .h files with this compiler in some of the XCode settings as well, but I haven't actually done this myself.

Flash!
Quote this message in a reply
Apprentice
Posts: 5
Joined: 2009.05
Post: #5
You were right flash.
I renamed my obj-c file in mm and compiles !
i just had to add two includes in the PVRTModelPOD.cpp file PVRTVertex.h and PVRTBoneBatch.h and i have no more errors! Smile
I still don't understand how people can get it to build directly without doing all this...it's wierd.

Well thanks a lot !
Quote this message in a reply
Member
Posts: 166
Joined: 2009.04
Post: #6
KEMISTRY Wrote:I still don't understand how people can get it to build directly without doing all this...it's wierd.

Well thanks a lot !

Because I had no objective-c files to begin with .. I compiled their entire SDK as a pure static library.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  How many uniform vectors can iPad PowerVR SGX support linghuye 0 2,839 Aug 30, 2010 02:40 AM
Last Post: linghuye