Search code examples
c++macossimdsonyvectormath

SIMD Sony Vector Math Library in OS X with C++


I'm currently writing a very simple game engine for an assignment and to make the code a lot nicer I've decided to use a vector math library. One of my lecturers showed me the Sony Vector Math library which is used in the Bullet Physics engine and it's great as far as I can see. I've got it working on Linux nicely but I'm having problems porting it to work on OS X (intel, Snow Leopard). I have included the files correctly in my project but the C++ version of the library doesn't seem to compile. I can get the C version of the library working but it has a fairly nasty API compared to the C++ version and the whole reason of using this library was to neaten the code in the first place.

http://glosx.blogspot.com/2008/07/sony-vector-math-library.html

This blog post that I've stumbled upon seems to suggest something's up with the compiler? It's fairly short so I couldn't take a lot of information from it.

When I try to use the C++ version I get the following errors (expanded view of each error):

/usr/include/vectormath/cpp/../SSE/cpp/vectormath_aos.h:156:0
/usr/include/vectormath/cpp/../SSE/cpp/vectormath_aos.h:156: 
error: '__forceinline' does not name a type

second error:

/Developer/apps/gl test/main.cpp:7:0 In file included from /Developer/apps/gl test/main.cpp

/usr/include/vectormath/cpp/vectormath_aos.h:38:0 In file included from   
/usr/include/vectormath/cpp/vectormath_aos.h

/usr/include/vectormath/cpp/../SSE/cpp/vectormath_aos.h:330:0 In file included from
/usr/include/vectormath/cpp/../SSE/cpp/vectormath_aos.h

/usr/include/vectormath/cpp/../SSE/cpp/vecidx_aos.h:45:0 Expected constructor, destructor, 
or type conversion before '(' token in     /usr/include/vectormath/cpp/../SSE/cpp/vecidx_aos.h

Finally two errors at the end of the main.cpp file:

Expected '}' at the end of input
Expected '}' at the end of input

I've Googled my heart out but I can't seem to find any answers or anything to point me in the right direction so any help will be greatly received.

Thanks,


Solution

  • Which compiler are you using on OS X ? There are 4 to choose from in the standard Xcode 3.2 install and the default is gcc 4.2. You might be better off trying gcc 4.0.