The following snippet does not compile with g++ v4.8.2:
The command
It seems, that abs is a member of the namespace std, but fmax is not. The version of the g++ is
I also have installed g++ v4.2.1 and v4.6.3. g++ v4.8.1 in Arch Linux and in MinGW compiles this code without errors. How should I fix this problem?
Code:
#include <cmath>
int main()
{
double m = std::fmax(2., 8.);
m = std::abs(2.);
}
The command
g++48 -std=c++11 asd.cpp
gives this error:
Code:
asd.cpp: In function 'int main()':
asd.cpp:6:14: error: 'fmax' is not a member of 'std'
double m = std::fmax(2., 8.);
^
asd.cpp:6:14: note: suggested alternative:
In file included from /usr/local/lib/gcc48/include/c++/cmath:44:0,
from asd.cpp:2:
/usr/include/math.h:270:8: note: 'fmax'
double fmax(double, double) __pure2;
^
It seems, that abs is a member of the namespace std, but fmax is not. The version of the g++ is
Code:
g++48 (FreeBSD Ports Collection) 4.8.2 20130919 (prerelease)
I also have installed g++ v4.2.1 and v4.6.3. g++ v4.8.1 in Arch Linux and in MinGW compiles this code without errors. How should I fix this problem?