Linux 下用gcc 编译不能识别sqrt 加上-lm 也不可以
我在Linux下用gcc 编译程序:
利用命令: gcc -lm -o root root.c
显示: root.c:(.text+0xa4):Undefine reference to 'sqrt'
root.c:(.text+0xd0):Undefine reference to 'sqrt'
collect2: ld 返回 1
我在程序的开头已经加上了 #include <math.h>
请高手指教!
谢谢
利用命令: gcc -lm -o root root.c
显示: root.c:(.text+0xa4):Undefine reference to 'sqrt'
root.c:(.text+0xd0):Undefine reference to 'sqrt'
collect2: ld 返回 1
我在程序的开头已经加上了 #include <math.h>
请高手指教!
谢谢
...全文
相关推荐
在编译时为什么要加上 –lm ?
Linux 中常用链接来解决一些库函数的问题。在编译时链接可以生成可执行文件。了解一些链接的基本过程,能让我们在开发中减去不少的麻烦! 编译时使用 gcc -lm 程序功能很简单,下面的示例展示了exp()函数的用法。 (代码一) #include #include //exp int main(int argc, char const *argv[]){ //double x = 0; printf(The exponential value of %lf is %lf\n, 0, exp(0)); printf(The exponential value of %
linux下gcc编译器的使用.rar
linux下gcc编译器的使用.rar
Linux下CC++编译器gcc使用简介.doc
Linux下CC++编译器gcc使用简介
Intel I219-LM网卡驱动源码以及说明文件.zip
该文件是intel I219-lm网络适配器的驱动程序源码,适用于在Linux下使用,主要是编译安装,压缩包内有源码程序和说明文件
怎样在linux下编写C程序并编译执行
一、Hello, world!在linux下输入:(以hello.c为例)首先选中文件要保存的路径(如:cd work)vi hello.c(要编辑的文件名)输入程序:# includeint main(void){p...


