- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
最近,我正在尝试将 Apache Ant 与 g++4.8 与 -std=c++11
一起使用。 .
如果我尝试了这段代码,它就通过了。
#include <cmath>
...
sqrtf((float)100);
#include <cmath>
...
sqrt((float)100);
/usr/bin/ld: test.o: undefined reference to symbol 'sqrtf@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libm.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
-lm
也无济于事。有任何想法吗?
最佳答案
问题不在于 apache ant,在某些 Linux 发行版中,g++ 和 gcc 编译器需要“-lm”来链接 C 中的“math.h”和 C++ 中的“cmath”所包含的 cmath 库
关于ubuntu - ld : "undefined reference to symbol ' sqrtf'"error with G++ via Apache Ant,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40321507/
我正在使用 Linux,Ubuntu 12.04 (Precise Pangolin),以及用于编码的 Geany。在我使用 sqrtf 命令求 float 的平方根之前,我用 C 编写的代码工作得很
我正在尝试创建一个软件来显示两个向量之间的角度,当它等于 (1,1,2) 时它不起作用,因此这个向量的模数是 sqrtf(6),它是 2.449490 并且它应该是 2.44948974278318。
我在 Ubuntu 11.04 下工作,现在从事一个项目,其源代码使用“sqrtf”或“lgamma”等例程,我的 IDE 提示这些例程,声称在“math.h”中找不到它们。一位高级成员告诉我,我需要
我想考虑编码。首先是: #include #include #include using namespace std; int main() { int s = 25; cout
这个问题已经有答案了: lvalue required as left operand of assignment (2 个回答) 已关闭 3 年前。 我试图在给定底和高的情况下找到三角形斜边的长度。
编译我的程序后 $ cmake . $ make 我收到 5 个这种形式的错误: $ make Scanning dependencies of target Project [ 50%] Build
我在项目中链接 libgcc.a 时遇到问题。我需要使用 sqrtf 和 log10f,因此我通过添加链接器标志“-lm”在 makefile 中添加了 libgcc.a,将 math.h 包含在模块
我一直在使用 swift 上的数学函数时遇到问题。 Sinf()、sqrtf() 适用于 iPhone 5 模拟器,但不适用于 iPhone 5S。 Sin() 和 sqrt() 可以在 iPhone
当我尝试编译时 #include #include int main() { double m=1.66666; double k=sqrtf(m); return 0; } 使
#include #include #include #include int main() { typedef union { uint32_t u; float f; } uflo
以下代码是缓动方程的一部分。我只是对语法感兴趣。 sqrtf(1 - (t = t/d - 1) * t); 我以前从未见过像这样使用“=”运算符。它在这种情况下有什么作用? 编辑:代码来自著名的 R
最近,我正在尝试将 Apache Ant 与 g++4.8 与 -std=c++11 一起使用。 . 如果我尝试了这段代码,它就通过了。 #include ... sqrtf((float)100)
我是一名优秀的程序员,十分优秀!