C++ GLM:Can';我不再编译了

C++ GLM:Can';我不再编译了,c++,gcc,compiler-errors,clang,glm-math,C++,Gcc,Compiler Errors,Clang,Glm Math,还有人用了吗 去年对我来说效果很好,但现在我的代码没有编译: (根据通用条款4.6.1,在MinGW上): 包含在../include/glm//core/func_packing.hpp:190:0中的文件中, 从../include/glm/glm.hpp:103, 从SmoothRenderer.cpp:11: ../include/glm//core/func_packing.inl:在函数“glm::detail::uint32 glm::packUnorm4x8(const glm:

还有人用了吗

去年对我来说效果很好,但现在我的代码没有编译:

(根据通用条款4.6.1,在MinGW上):

包含在../include/glm//core/func_packing.hpp:190:0中的文件中,
从../include/glm/glm.hpp:103,
从SmoothRenderer.cpp:11:
../include/glm//core/func_packing.inl:在函数“glm::detail::uint32 glm::packUnorm4x8(const glm::detail::tvec4&)”中:
../include/glm//core/func_packing.inl:84:17:错误:应在“(”标记之前使用主表达式
../include/glm//core/func_packing.inl:84:17:错误:在“')标记之前应包含主表达式
../include/glm//core/func_packing.inl:84:17:错误:应为“;”在“回合”之前
../include/glm//core/func_packing.inl:85:26:错误:“D”未在此范围内声明
../include/glm//core/func_packing.inl:在函数“glm::detail::tvec4 glm::unpunorm4x8(const uint32&)”中:
../include/glm//core/func_packing.inl:94:38:警告:语句无效[-Wunused value]
../include/glm//core/func_packing.inl:99:4:错误:“D”未在此范围内声明
这是最新版本的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);
                                        ^
                                        ;
SmoothRenderer.cpp:10中包含的文件中的
:
在../include/glm/glm.hpp:103中包含的文件中:
在../include/glm//core/func_packing.hpp:190中包含的文件中:
../include/glm/core/func_packing.inl:84:33:错误:函数样式转换或类型构造应为“(”
详图:uint8 D((详图:uint8)圆形(夹具(v.w,0.0f,1.0f)*255.0f));
~~~~~~~~~~~~~^
./util.h:330:15:注意:从宏“D”展开
#定义D(x)x
^
在SmoothRenderer.cpp:10中包含的文件中:
在../include/glm/glm.hpp:103中包含的文件中:
在../include/glm//core/func_packing.hpp:190中包含的文件中:
../include/glm/core/func_packing.inl:85:26:错误:使用了未声明的标识符“D”

返回详细信息::uint32((D是的,
D
宏出了问题。该死,问了4分钟后回答我的问题。这就是解释问题的美妙之处。一半的时间就足够了


这是避免使用预处理器的另一个原因。Mad错误。不过,值得赞扬的是,clang很好,不仅提到了在别处定义的宏似乎有问题,它甚至将它复制到那里给我看。

我刚刚意识到。可能有宏冲突,因为我记得在这期间我对调试进行了更改宏将其从
DEBUG
重命名为
D
。这太可怕了。
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);
                                        ^
                                        ;