by mike_kamau · 1y ago · 0 comments
/opensource/implot3d/implot3d.cpp:2650:20: error: no member named 'sin' in namespace 'std'
2650 | float s = std::sin(half_angle);
| ~~~~~^
/opensource/implot3d/implot3d.cpp:2654:14: error: no member named 'cos' in namespace 'std'
2654 | w = std::cos(half_angle);
| ~~~~~^
/opensource/implot3d/implot3d.cpp:2670:14: error: no member named 'fabs' in namespace 'std'
2670 | if (std::fabs(normalized_dot - 1.0f) < epsilon) {
| ~~~~~^
/opensource/implot3d/implot3d.cpp:2680:14: error: no member named 'fabs' in namespace 'std'
2680 | if (std::fabs(normalized_dot + 1.0f) < epsilon) {
| ~~~~~^
/opensource/implot3d/implot3d.cpp:2682:45: error: no member named 'fabs' in namespace 'std'
2682 | ImPlot3DPoint arbitrary_axis = std::fabs(v0.x) > std::fabs(v0.z) ? ImPlot3DPoint(-v0.y, v0.x, 0.0f)
| ~~~~~^
/opensource/implot3d/implot3d.cpp:2682:63: error: no member named 'fabs' in namespace 'std'
2682 | ImPlot3DPoint arbitrary_axis = std::fabs(v0.x) > std::fabs(v0.z) ? ImPlot3DPoint(-v0.y, v0.x, 0.0f)
| ~~~~~^
/opensource/implot3d/implot3d.cpp:2695:24: error: no member named 'acos' in namespace 'std'
2695 | float angle = std::acos(normalized_dot);
| ~~~~~^
/opensource/implot3d/implot3d.cpp:2697:20: error: no member named 'sin' in namespace 'std'
2697 | float s = std::sin(half_angle);
| ~~~~~^
/opensource/implot3d/implot3d.cpp:2701:16: error: no member named 'cos' in namespace 'std'
2701 | q.w = std::cos(half_angle);
| ~~~~~^
/opensource/implot3d/implot3d.cpp:2707:17: error: no member named 'sqrt' in namespace 'std'
2707 | return std::sqrt(x * x + y * y + z * z + w * w);
| ~~~~~^
/opensource/implot3d/implot3d.cpp:2786:26: error: no member named 'acos' in namespace 'std'
2786 | float theta_0 = std::acos(dot); // Angle between input quaternions
| ~~~~~^
/opensource/implot3d/implot3d.cpp:2788:28: error: no member named 'sin' in namespace 'std'
2788 | float sin_theta = std::sin(theta); // Sine of interpolated angle
| ~~~~~^
/opensource/implot3d/implot3d.cpp:2789:30: error: no member named 'sin' in namespace 'std'
2789 | float sin_theta_0 = std::sin(theta_0); // Sine of original angle
| ~~~~~^
/opensource/implot3d/implot3d.cpp:2791:21: error: no member named 'cos' in namespace 'std'
2791 | float s1 = std::cos(theta) - dot * sin_theta / sin_theta_0; GLFW Error 65543: NSGL: The targeted version of macOS only supports forward-compatible core profile contexts for OpenGL 3.2 and above
...which is fixed by changing the GLFW window hints like this: glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GLFW_TRUE);
I'll see if I can create a pull-request...Edit: https://github.com/brenocq/implot3d/pull/7
PS: it looks like the code was tested only on Linux, since the Windows build seems to suffer from the same `std::` prefix problem: https://github.com/floooh/implot3d/actions/runs/12393862255