我正在尝试将 Xcode 项目( link )转换为 VS2008 解决方案。
在 cuda 文件类型中 .cu
, 术语 MAXFLOAT
用来。我正在添加以下标题,但错误未解决。
#include <stdio.h>
#include <math.h>
在 Xcode 项目中,我试图找到定义但没有。此外,该术语仅在此文件中使用。这是 Xcode 特有的吗?
最佳答案
MAXFLOAT
是一个非标准参数。使用以下可移植替代方案之一:
FLT_MAX
(在 <float.h>
中定义)。 std::numeric_limits<float>::max
(在 <limits>
中定义)。您仍然可以使用 C 的 FLT_MAX
,但包括 <cfloat>
反而。 关于xcode - 错误 : identifier "MAXFLOAT" is undefined,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28980541/