LikeTaskManager icon indicating copy to clipboard operation
LikeTaskManager copied to clipboard

Fails to build with `error: ‘fmod’ is not a member of ‘std’` in `ltm_cpu.cpp:48:31`.

Open dreirund opened this issue 1 year ago • 4 comments

When I try to build this software (using ↗ this build recipe), it fails with

g++ -c -pipe -g0 -march=x86-64 -mtune=native -O3 -ffat-lto-objects -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -fomit-frame-pointer -fPIC -fpermissive -std=gnu++1y -flto -fno-fat-lto-objects -Wall -Wextra -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I/usr/include/qwt -I/usr/include/qt -I/usr/include/qt/QtWidgets -I/usr/include/qt/QtGui -I/usr/include/qt/QtNetwork -I/usr/include/qt/QtCore -I. -I. -I/usr/lib/qt/mkspecs/linux-g++ -o ltm_cpu.o ltm_cpu.cpp
ltm_cpu.cpp: In lambda function:
ltm_cpu.cpp:48:31: error: ‘fmod’ is not a member of ‘std’
   48 |             currentHue = std::fmod(currentHue, 1.0f);
      |                               ^~~~
ltm_cpu.cpp: In member function ‘void LTM::plot_cpu_activity()’:
ltm_cpu.cpp:91:26: warning: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare]
   91 |         for(size_t i=0; i<DataVec.size(); i++){
      |                         ~^~~~~~~~~~~~~~~
make: *** [Makefile:1534: ltm_cpu.o] Error 1

Compilation environment:

  • gcc --version | head -n1:
    gcc (GCC) 12.2.1 20230201
  • CFLAGS=" -g0 -march=x86-64 -mtune=native -O3 -flto -ffat-lto-objects -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -fomit-frame-pointer -fPIC"
  • CXXFLAGS="-g0 -march=x86-64 -mtune=native -O3 -flto -ffat-lto-objects -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -fomit-frame-pointer -fPIC -fpermissive"
  • LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,--hash-style=gnu"

dreirund avatar Feb 28 '23 15:02 dreirund