小编dSt*_*ack的帖子

使用quadmath的G ++ 4.6.3 Linux中的四倍精度

我尝试执行代码

#include <quadmath.h>
#include <iostream>
int main()
{
  char* y = new char[1000];
  quadmath_snprintf(y, 1000, "%Qf", 1.0q);
  std::cout << y << std::endl;
  return 0;
}
Run Code Online (Sandbox Code Playgroud)

用命令

g++ test.cpp -o test
Run Code Online (Sandbox Code Playgroud)

我收到错误:

/tmp/cctqto7E.o: In function `main':
test.cpp:(.text+0x51): undefined reference to `quadmath_snprintf(char*, unsigned int, char const*, ...)'
collect2: ld returned 1 exit status
Run Code Online (Sandbox Code Playgroud)

版本是:

g++ --version
g++ (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not …
Run Code Online (Sandbox Code Playgroud)

linux ubuntu quadruple-precision

6
推荐指数
1
解决办法
1162
查看次数

标签 统计

linux ×1

quadruple-precision ×1

ubuntu ×1