错误:标识符“MAXFLOAT”未定义 [英] Error: identifier "MAXFLOAT" is undefined
问题描述
我正在尝试将Xcode项目(链接)转换为VS2008解决方案。
I am trying to convert a Xcode project (link) to a VS2008 solution.
在cuda文件类型 .cu
中,使用术语 MAXFLOAT
。我添加了以下标头,但错误未解决。
In a cuda filetype .cu
, the term MAXFLOAT
is used. I am adding the following headers but the error is not resolved.
#include <stdio.h>
#include <math.h>
在Xcode项目中,我试图找到定义,但没有。此术语仅用于此文件。
In the Xcode project, I tried to locate the definition but there is none. Also this term is only used in this file. Is this something specific to Xcode?
推荐答案
标准参数。使用以下可移植替代方法之一:
MAXFLOAT
is a non-standard parameter. Use one of the following, portable alternatives:
-
在C中:使用标准库
FLT_MAX
(在
< float.h> $ c中定义) $ c>
)。
在C ++中:使用 std :: numeric_limits< float> :: max
(在 < limits>
)。您仍然可以使用C的 FLT_MAX
,但包括 <$
In C++: use std::numeric_limits<float>::max
(defined in <limits>
). You may still use C's FLT_MAX
, but include <cfloat>
instead.
这篇关于错误:标识符“MAXFLOAT”未定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!