1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include\cstdlib(18): error C2589: “(”:“::”右边的非法标记 1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include\cstdlib(18): error C2146: 语法错误: 缺少“)”(在标识符“fabs”的前面) 1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include\cstdlib(18): error C2066: 转换到函数类型是非法的 1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include\cstdlib(18): error C2059: 语法错误:“)” 1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include\cstdlib(18): error C2440: “类型转换”: 无法从“double”转换为“unknown-type (__cdecl *)(float)” 1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include\cstdlib(18): note: 没有使该转换得以执行的上下文 1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include\cmath(19): error C2589: “(”:“::”右边的非法标记 1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include\cmath(19): error C2146: 语法错误: 缺少“)”(在标识符“acos”的前面) 1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include\cmath(19): error C2066: 转换到函数类型是非法的 1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include\cmath(19): error C2059: 语法错误:“)” 1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include\cmath(19): error C2440: “类型转换”: 无法从“double”转换为“unknown-type (__cdecl *)(float)” 1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include\cmath(19): note: 没有使该转换得以执行的上下文1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include\xlocnum(81): error C2589: “(”:“::”右边的非法标记 1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include\xlocnum(81): error C2062: 意外的类型“unknown-type” 1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\include\xlocnum(81): error C2059: 语法错误:“)”
这种情况下,需要调整.cpp文件中的头文件引用顺序,例如
A.cpp中
#include X.h
#include Y.h
#include A.h
尝试调整一下X.h和Y.h和A.h的顺序
时间: 2024-10-31 23:56:17