HLML icon indicating copy to clipboard operation
HLML copied to clipboard

C++ standard 20 conflicting definitions of lerp function

Open bonorumetmalorum opened this issue 1 year ago • 1 comments

On Ubuntu 22.04.3 LTS using G++ and Clang++ with CPP standard 20 there are conflicting definitions of the lerp function. Here is the full error message:

[build] [ 50%] Building CXX object CMakeFiles/testexe.dir/main.o [build] In file included from /home/sigill/Dev/CPP/HLMLTest/./cpp/hlml. [HLML_lerp_conflict_test.zip](https://github.com/dangmoody/HLML/files/14343402/HLML_lerp_conflict_test.zip) h:127, [build] from /home/sigill/Dev/CPP/HLMLTest/main.cpp:1: [build] /home/sigill/Dev/CPP/HLMLTest/./cpp/hlml_functions_scalar.h:170:69: error: ‘float lerp(float, float, float)’ conflicts with a previous declaration [build] 170 | HLML_INLINE float lerp( const float a, const float b, const float t ) [build] | ^ [build] In file included from /usr/include/c++/11/math.h:36, [build] from /home/sigill/Dev/CPP/HLMLTest/./cpp/hlml_functions_scalar.h:41, [build] from /home/sigill/Dev/CPP/HLMLTest/./cpp/hlml.h:127, [build] from /home/sigill/Dev/CPP/HLMLTest/main.cpp:1:

Please find attached the sample project used to generate the above error message: HLML_lerp_conflict_test.zip

The lerp functions were added in standard 20: https://en.cppreference.com/w/cpp/numeric/lerp but for some reason MSVC does not throw any compilation errors here.

bonorumetmalorum avatar Feb 20 '24 11:02 bonorumetmalorum

Have the fix for this ready to go, it just needs some more testing. Will close this when the release with the fix is put out.

dangmoody avatar Jun 20 '24 20:06 dangmoody

Fixed in 650785f, published in v2.3.0 release.

dangmoody avatar Aug 01 '24 12:08 dangmoody