VC++的一个奇怪的C2732错误

原来编译都正常的(ScaleForm 3.3的代码)

升级了VS2015编译后,就出问题了。nvtt编译错误如下:

1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\stdarg.h(20): warning C4005: 'va_copy': macro redefinition

1>  d:\sdk\gfx sdk 3.3\3rdparty\nvtt\src\nvcore\DefsVcWin32.h(32): note: see previous definition of 'va_copy'
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xtgmath.h(88): error C2732: linkage specification contradicts earlier specification for 'acos_assert'
1>  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xtgmath.h(88): note: see declaration of 'acos_assert'
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xtgmath.h(89): error C2732: linkage specification contradicts earlier specification for 'asin_assert'
1>  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xtgmath.h(89): note: see declaration of 'asin_assert'
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xtgmath.h(109): error C2732: linkage specification contradicts earlier specification for 'sqrt_assert'

1>  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xtgmath.h(109): note: see declaration of 'sqrt_assert'


非常奇怪的问题。

解决方法是,让<std....> <cmath> <algrithm>等包含头文件尽量在前面包含。


你可能感兴趣的:(VC++的一个奇怪的C2732错误)