Ric*_*ams 5 c++ x11 enums physx
我正在尝试将 NVIDIA 的 PhysX 集成到我的 Linux 代码库中。在它的一些头文件中,它定义了以下枚举:
\n\nphysxvisualdebuggersdk/PvdErrorCodes.h
\n\nstruct PvdErrorType\n{\n enum Enum\n {\n Success = 0,\n NetworkError,\n ArgumentError,\n InternalProblem\n };\n};\nRun Code Online (Sandbox Code Playgroud)\n\nphysxprofilesdk/PxProfileCompileTimeEventFilter.h:
\n\nstruct EventPriorities\n{\n enum Enum\n {\n None, // the filter setting to kill all events\n Coarse,\n Medium,\n Detail,\n Never // the priority to set for an event if it should never fire.\n };\n};\nRun Code Online (Sandbox Code Playgroud)\n\n这会导致以下编译错误:
\n\n/usr/local/include/PhysX3/physxvisualdebuggersdk/PvdErrorCodes.h:36:4: error: expected identifier before numeric constant\n Success = 0,\n ^\n/usr/local/include/PhysX3/physxvisualdebuggersdk/PvdErrorCodes.h:36:4: error: expected \xe2\x80\x98}\xe2\x80\x99 before numeric constant\n/usr/local/include/PhysX3/physxvisualdebuggersdk/PvdErrorCodes.h:36:4: error: expected unqualified-id before numeric constant\nRun Code Online (Sandbox Code Playgroud)\n\n和
\n\n/usr/local/include/PhysX3/physxprofilesdk/PxProfileCompileTimeEventFilter.h:46:4: error: expected identifier before numeric constant\n None, // the filter setting to kill all events\n ^\n/usr/local/include/PhysX3/physxprofilesdk/PxProfileCompileTimeEventFilter.h:46:4: error: expected \xe2\x80\x98}\xe2\x80\x99 before numeric constant\n/usr/local/include/PhysX3/physxprofilesdk/PxProfileCompileTimeEventFilter.h:46:4: error: expected unqualified-id before numeric constant\nRun Code Online (Sandbox Code Playgroud)\n\n我确定这是因为X11/Xh #定义了“无”和“成功”。我已经确认这是问题所在,因为如果我 #undef 'None' 和 'Success',我就不再有错误。然而,这显然不是一件可取的事情。
\n\n我的问题是:作为必须使用这两个标头的开发人员,我应该采取的正确做法是什么?我应该将其作为错误报告给 NVIDIA 并等待修复,还是我可以自己做一些事情来解决该问题(除了#undef)?
\n\n谢谢你的时间!
\n| 归档时间: |
|
| 查看次数: |
3033 次 |
| 最近记录: |