使用__float128编译C++代码

enc*_*enc 4 c++ g++ c++11

我正在尝试__float128在我的C++程序中使用.

但是我在编译时遇到了麻烦.

这是简单的c ++代码(test.cc):

#include <iostream>
#include <quadmath.h>

using namespace std;

int main(){
  __float128 r=0.0q;
  __float128 exp_d = expq(12.45q);

  cout << "r=" << (double)r << endl;
  cout << "exp_d=" << (double)exp_d << endl;
}
Run Code Online (Sandbox Code Playgroud)

我用这个代码编译

g++ test.cc -lquadmath -std=c++11

附带以下错误

error:unable to find numeric literal operator 'operateor"" q'

我该如何解决?

Mar*_*sse 9

Gcc-5打印这个有用的附加说明:

note: use -std=gnu++11 or -fext-numeric-literals to enable more built-in suffixes
Run Code Online (Sandbox Code Playgroud)