문제

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,

도움이 되었습니까?

해결책

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.

다른 팁

__forceinline is a reserved word that is supported by only a couple compilers. Clearly, your compiler does not support the __forceinline keyword and the code in question is non-portable.

A very poor workaround would be to pass a new define to your compiler that gives the keyword the correct meaning. E.g.: -D__forceinline=inline or -D__forceinline=__attribute__((always_inline)) (Thanks Paul!)

사용자가 작성한 HTTP 응답 메시지에 콘텐츠를 작성하지 않았습니다.일부 콘텐츠를 추가해보십시오.

public class ServiceLayerExceptionFilter : ExceptionFilterAttribute
{
    public override void OnException(HttpActionExecutedContext context)
    {
        var message = new HttpResponseMessage(HttpStatusCode.InternalServerError);
        message.CreateContent(typeof(Foo), new Foo { Bar = "baz" });
        context.Result = message;
    }
}
.

Postgres에서는 고유 한 제약 조건이 고유 한 B- 트리 색인 로 구현됩니다. 문서 별 : <. / P>

고유 제한 조건을 추가하면 자동으로 고유 한 Btree를 만듭니다. 제약 조건에서 사용되는 열 또는 열의 열의 색인.

인덱스 테이블 : 데이터 페이지 배열과 동일한 기본 저장 메커니즘을 사용합니다. 인덱스에는 약간의 추가 기능이 있습니다. 문서 별 :

테이블에서 항목은 행입니다. 색인에서 항목은 인덱스 항목입니다.

모든 테이블과 색인은 고정 크기의 페이지 배열로 저장됩니다. (일반적으로 8KB, 다른 페이지 크기를 선택할 수 있지만 서버 컴파일).

인덱스 항목의 최대 크기는 데이터 페이지의 3 분의 1이며, 이에 대한 Peter Eisentraut :

PostgreSQL 기본 키 길이 제한

2730 바이트 (또는 조금 더 적음). 의미 은 불가능합니다

해시 값이있는 중복 열을 추가하고 에서 고유 한 인덱스를 만듭니다.
내장 된 함수를 사용할 수 있습니다 "Nofollow Noreferrrer"> UNIQUE < / A> 또는 거대한 값에 더 효율적인 것.

여기에 성능에 중점을 둡니다 에 초점을 맞춘 관련 솔루션입니다. 인덱스 최대 행 크기 오류

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top