@all
Please help
c++ -Wall -Wextra -pedantic -g `sdl2-config --cflags --static-libs` -std=c++11 -ISDK:local/common/include/libxml2 -O -c -o StateMainMenu.o StateMainMenu.cpp
StateMainMenu.cpp: In member function 'virtual void StateMainMenu::draw()':
StateMainMenu.cpp:116:33: error: 'round' is not a member of 'std'; did you mean 'round'?
116 | int posX = std::round(800 / 2 - mMenuRenderedTexts[i].getWidth() / 2),
| ^~~~~
In file included from /Development/Coding/SDK/gcc/include/c++/11.1.0/cmath:45,
from /Development/Coding/SDK/gcc/include/c++/11.1.0/math.h:36,
from /SDK/local/newlib/include/SDL2/SDL_stdinc.h:90,
from /SDK/local/newlib/include/SDL2/SDL_main.h:25,
from /SDK/local/newlib/include/SDL2/SDL.h:32,
from State.h:5,
from StateMainMenu.h:4,
from StateMainMenu.cpp:3:
/SDK/newlib/include/math.h:218:15: note: 'round' declared here
218 | extern double round _PARAMS((double));
| ^~~~~
StateMainMenu.cpp:120:42: error: 'posY' was not declared in this scope; did you mean 'posX'?
120 | mMenuRenderedTexts[i].draw(posX, posY, 3);
| ^~~~
| posX
gmake: *** [StateMainMenu.o] Error 1
Line in question is
// Calculate the horizontal and vertical positions
int posX = std::round(800 / 2 - mMenuRenderedTexts[i].getWidth() / 2),
posY = mMenuYStart + i * mMenuYGap;
What is it trying to tell me?
"round" is not usable, why not use "round"???
Are you kidding me?
It obviously found it in math.h, but refuses to use it? Why?
using namespace std;
doesn't help
The second error (posY) is probably a collateral?
Thanks in advance