2013-03-26 5 views
0

아무도 this library을 더 이상 사용하지 않습니까? GLM : 더 이상 컴파일 할 수 없습니다.

작년에 나를 위해 좋은 일했다하지만 지금은 내 코드는 컴파일되지 않습니다

(는 MinGW에 GCC 4.6.1로) :

In file included from ../include/glm/./core/func_packing.hpp:190:0, 
       from ../include/glm/glm.hpp:103, 
       from SmoothRenderer.cpp:11: 
../include/glm/./core/func_packing.inl: In function 'glm::detail::uint32 glm::packUnorm4x8(const glm::detail::tvec4<float>&)': 
../include/glm/./core/func_packing.inl:84:17: error: expected primary-expression before '(' token 
../include/glm/./core/func_packing.inl:84:17: error: expected primary-expression before ')' token 
../include/glm/./core/func_packing.inl:84:17: error: expected ';' before 'round' 
../include/glm/./core/func_packing.inl:85:26: error: 'D' was not declared in this scope 
../include/glm/./core/func_packing.inl: In function 'glm::detail::tvec4<float> glm::unpackUnorm4x8(const uint32&)': 
../include/glm/./core/func_packing.inl:94:38: warning: statement has no effect [-Wunused-value] 
../include/glm/./core/func_packing.inl:99:4: error: 'D' was not declared in this scope 

이 최신 버전 0.9.4.3와 함께입니다. 최신 그 소리 내 Mac에서

유사 문제 :

In file included from SmoothRenderer.cpp:10: 
In file included from ../include/glm/glm.hpp:103: 
In file included from ../include/glm/./core/func_packing.hpp:190: 
../include/glm/core/func_packing.inl:84:33: error: expected '(' for function-style cast or type construction 
       detail::uint8 D((detail::uint8)round(clamp(v.w, 0.0f, 1.0f) * 255.0f)); 
           ~~~~~~~~~~~~~^ 
./util.h:330:15: note: expanded from macro 'D' 
# define D(x) x 
      ^
In file included from SmoothRenderer.cpp:10: 
In file included from ../include/glm/glm.hpp:103: 
In file included from ../include/glm/./core/func_packing.hpp:190: 
../include/glm/core/func_packing.inl:85:26: error: use of undeclared identifier 'D' 
       return detail::uint32((D << 24) | (C << 16) | (B << 8) | A); 
            ^
../include/glm/core/func_packing.inl:99:4: error: use of undeclared identifier 'D' 
         D * 1.0f/255.0f); 
         ^
../include/glm/core/func_packing.inl:94:30: warning: expression result unused [-Wunused-value] 
       detail::uint32 D((p >> 24) & Mask8); 
       ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~ 
./util.h:330:15: note: expanded from macro 'D' 
# define D(x) x 
      ^
In file included from SmoothRenderer.cpp:10: 
In file included from ../include/glm/glm.hpp:108: 
In file included from ../include/glm/./core/func_noise.hpp:85: 
../include/glm/core/func_noise.inl:125:33: error: too many arguments provided to function-like macro invocation 
       detail::tvec4<T> const D(0.0, 0.5, 1.0, 2.0); 
              ^
../include/glm/core/func_noise.inl:125:27: error: expected ';' at end of declaration 
       detail::tvec4<T> const D(0.0, 0.5, 1.0, 2.0); 
             ^
             ; 

이 헤더 전용 라이브러리입니다. 이런 일이 일어나지 않아야합니다 ...

일부 4x4 행렬 곱셈과 역변환에만 사용합니다. 나머지 애플 리케이션은 LAPACK을 광범위하게 사용하기 때문에 glm이 정말로 필요로하는 것은 없습니다. 그러나 내가 매우 휴대하기 쉽게하려고하는 코드가 이렇게 무작위로 끊어지면 나는 싫어한다.

+0

방금 ​​깨달았습니다. 중간에 기억하는 것처럼 매크로 충돌이있을 수 있습니다. 디버그 매크로의 이름을'DEBUG'에서'D'로 변경했습니다. 이것은 끔찍한 일입니다. –

답변

2

그래, D 매크로의 문제로 판명되었습니다. 젠장, 4 분 후에 내 질문에 답해. 그것은 문제를 설명하는 아름다움입니다. 절반은 시간이야.

전 처리기 사용을 피하는 또 다른 이유 중 하나입니다. 미친 오류. 그것의 신용으로, clang는 비록 다른 곳에서 정의 된 매크로를 사용하면 무언가가 보이지 않을뿐만 아니라 거기에 복사하여 그것을 보여주기에 충분할만큼 좋았습니다.

관련 문제