Open QuellaZhang opened 2 years ago
Hey, thank you for the report! I'm a bit confused, is it that the latest version of C++ has a globally defined lerp function without the need for any namespace specifier (like std::)? I simply use a custom lerp function defined high up in the file and since I have no default namespace specifier (e.g. using namespace std;) I don't see how this would conflict.
Only if latest C++ version has a globally included lerp call without namespace specifiers which would seem like a really risky move on the C++ comittee. I can easily fix it on my end, but this could be a bigger flag?
@JoeyDeVries, I simply looked into the issue, lerp
function was defined in std
namespace in MSVC.
And I found some other headers include using namespace std;
. If you add /showIncludes
option when compiling F:\gitP\JoeyDeVries\LearnOpenGL\src\5.advanced_lighting\9.ssao\ssao.cpp
, you will get all header files and find that it includes mesh.h
, it will also include using namespace std;
.
@QuellaZhang oh of course! Didn't consider the header includes for a bit. I should get rid of the using namespace std
parts, but would require a lot of testing to see if everything still works. I've renamed the lerp
call for now to get rid of the ambiguity. Thanks for looking into it!
Hi All,
The MSVC team recently added LearnOpenGL as part of RWC testing. And we found some errors when building LearnOpenGL with '/std:c++latest'. Could you please help look at this issue? Thanks in advance. Looks like "lerp" needs to be renamed. See https://en.cppreference.com/w/cpp/numeric/lerp.
Build steps:
Error info: F:\gitP\JoeyDeVries\LearnOpenGL\src\5.advanced_lighting\9.ssao\ssao.cpp(179): error C2668: 'lerp': ambiguous call to overloaded function F:\gitP\JoeyDeVries\LearnOpenGL\src\5.advanced_lighting\9.ssao\ssao.cpp(38): note: could be 'float lerp(float,float,float)' C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\cmath(1314): note: or 'float std::lerp(const float,const float,const float) noexcept' F:\gitP\JoeyDeVries\LearnOpenGL\src\5.advanced_lighting\9.ssao\ssao.cpp(179): note: while trying to match the argument list '(float, float, float)'