VS 2017 中的标头 cmath 智能感知错误
header cmath Intellisense errors in VS 2017
标头 cmath 根本不起作用,当我在项目中打开 cmath 头文件时,VS 智能感知显示错误,例如 the global scope has no "acosf"
,并且有数百个。
我已经阅读了很多线程,但还没有弄清楚。我已经确认我正在根据一个线程使用 sdk 10.0.15063.0,但它不起作用。
包括 cmath 在内的任何项目都不起作用,因此它可能与特定代码无关。我已经尽力了,你们能告诉如何解决吗?提前感谢!
完整的错误列表如下:
Severity Code Description Project File Line Suppression State
Error (active) E0282 the global scope has no "acosf" Project7 c:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.12.25827includecmath 25
Error (active) E0282 the global scope has no "acoshf" Project7 c:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.12.25827includecmath 30
Error (active) E0282 the global scope has no "asinf" Project7 c:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.12.25827includecmath 35
Error (active) E0282 the global scope has no "asinhf" Project7 c:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.12.25827includecmath 40
Error (active) E0282 the global scope has no "atanf" Project7 c:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.12.25827includecmath 45
Error (active) E0282 the global scope has no "atanhf" Project7 c:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.12.25827includecmath 50
Error (active) E0282 the global scope has no "atan2f" Project7 c:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.12.25827includecmath 55
Error (active) E0282 the global scope has no "cbrtf" Project7 c:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.12.25827includecmath 60
Error (active) E0282 the global scope has no "ceilf" Project7 c:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.12.25827includecmath 65
Error (active) E0282 the global scope has no "copysignf" Project7 c:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.12.25827includecmath 71
Error (active) E0282 the global scope has no "cosf" Project7 c:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.12.25827includecmath 76
Error (active) E0282 the global scope has no "coshf" Project7 c:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.12.25827includecmath 81
Error (active) E0282 the global scope has no "erff" Project7 c:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.12.25827includecmath 86
Error (active) E0282 the global scope has no "erfcf" Project7 c:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.12.25827includecmath 91
Error (active) E0282 the global scope has no "expf" Project7 c:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.12.25827includecmath 96
Error (active) E0282 the global scope has no "exp2f" Project7 c:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.12.25827includecmath 101
Error (active) E0282 the global scope has no "expm1f" Project7 c:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.12.25827includecmath 106
Error (active) E0282 the global scope has no "fabsf" Project7 c:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.12.25827includecmath 111
Error (active) E0282 the global scope has no "fdimf" Project7 c:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.12.25827includecmath 116
Error (active) E0282 the global scope has no "floorf" Project7 c:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.12.25827includecmath 121
Error (active) E0282 the global scope has no "fmaf" Project7 c:Program Files (x86)Microsoft Visual Studio2017CommunityVCToolsMSVC14.12.25827includecmath 127
//etc
///////////////////////////编辑:这是包含 cmath 的标头,来自 Strousrup 的 c++ PPP:
ifndef GRAPH_GUARD
#define GRAPH_GUARD 1
#include "Point.h"
#include <vector>
#include <string>
#include <cmath>
#include "fltk.h"
#include "std_lib_facilities.h"
namespace Graph_lib {
// defense against ill-behaved Linux macros:
#undef major
#undef minor
struct Color {
enum Color_type {
red=FL_RED, blue=FL_BLUE, green=FL_GREEN,
yellow=FL_YELLOW, white=FL_WHITE, black=FL_BLACK,
magenta=FL_MAGENTA, cyan=FL_CYAN, dark_red=FL_DARK_RED,
dark_green=FL_DARK_GREEN, dark_yellow=FL_DARK_YELLOW, dark_blue=FL_DARK_BLUE
//etc
///////////////////////编辑:
using namespace std is included in "std_lib_facilities.h".
来自"std_lib_facilities.h"的斯皮内特:
#define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS 1
#ifndef H112
#define H112 201004L
#include<iostream>
#include<fstream>
#include<sstream>
#include<cmath>
#include<cstdlib>
#include<string>
#include<list>
#include<vector>
#include<algorithm>
#include<stdexcept>
//etc------------------
谢谢大家,我已经解决了问题。这是因为包含目录中不同math.h
的冲突。
相关文章:
- 1d 智能指针不适用于语法 (*)++
- 优先顺序:智能指针和类析构函数
- 对于C++中使用智能指针的指针算术限制,有没有一种变通方法
- cmath抛出错误C2062、C2059、C2143和C2447.cmath包含在矢量文件中
- 更新到莫哈韦后出现cmath错误
- 智能指针作为无序映射键,并通过引用进行比较
- 智能指针概念所有权和寿命
- 正在理解智能指针,但出现错误:未分配正在释放的指针
- 尝试使用智能指针时引发异常
- cmath 是否借用了 math.h 的实现
- 我可以制作指向智能指针的智能指针吗?
- 通过智能指针和转换对基本模板参数进行模板推导
- OpenCV 我应该使用智能指针来防止内存泄漏吗?
- 从堆栈分配的原始指针构造智能指针
- 初始化指向类实例的智能指针并访问其方法
- 如何使用 std::make_shared 创建基类类型的智能指针?
- 给定一个指向堆分配内存的指针,智能指针实现如何为其找到合适的释放函数?
- 构造智能点数据类型以及普通数据类型的通用方法
- 编译器不会使用 -std=c++11 编译智能指针
- VS 2017 中的标头 cmath 智能感知错误