gpt4 book ai didi

c++ - VS2010 中的 M_PI : working in Debug conf but not in Release

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:08:54 27 4
gpt4 key购买 nike

在我的非托管 C++ 源代码中,我有:

#define _USE_MATH_DEFINES
#include <cmath>

然后我用了几次 M_PI。在 Debug 配置中编译可以完美运行,但在 Release 中它给出:

error C2065: 'M_PI' : undeclared identifier

可能是什么配置属性导致了这种情况?

最佳答案

已解决。

我放了

#define _USE_MATH_DEFINES

之前

#include "stdafx.h"

在 (/Yu) 上启用预编译 header ,因为它处于 Release模式,它上面的所有内容都将被忽略。

关于c++ - VS2010 中的 M_PI : working in Debug conf but not in Release,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4077446/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com