turionpowercontrol / tpc

Cross-platform utility to control and tweak modern AMD processors
36 stars 12 forks source link

Compile failed on linux #43

Closed irocn closed 4 years ago

irocn commented 4 years ago

OS: ubuntu 18.04

MSVC_Round.h:5:17: error: ‘int round(float)’ conflicts with a previous declaration int round (float); ^ In file included from /usr/include/c++/7/math.h:36:0, from MSVC_Round.h:3, from MSVC_Round.cpp:1: /usr/include/c++/7/cmath:1771:3: note: previous declaration ‘constexpr float std::round(float)’ round(float __x) ^~~~~ Makefile:62: recipe for target 'obj/x86_64/MSVC_Round.o' failed make: *** [obj/x86_64/MSVC_Round.o] Error 1

ArnouldN commented 3 years ago

I have still the same bug in Ubuntu 20.04 and Linux Mint Debian Edition. So issue was closed but not corrected...

It is because function round() is defined twice, in the libraries of gcc and again in the source code of TurionPowerControl. If the funtion's name is modified in the files MSVC_Round.h and MSVC_Round.cpp to eg round_mod() then compilation is OK. TurionPowerControl then uses the standard round() function of gcc but works very well.