开发者

Program compiles on one server, doesn't on another

开发者 https://www.devze.com 2023-02-23 02:50 出处:网络
I\'m getting this error when I try and compile my program on my school\'s external server. Undefinedfirst referenced

I'm getting this error when I try and compile my program on my school's external server.

Undefined                       first referenced
 symbol                             in file
pow                                 /var/tmp//ccWbipvM.o
sqrt                                /var/tmp//开发者_如何学JAVAccWbipvM.o
ld: fatal: Symbol referencing errors. No output written to assign1
collect2: ld returned 1 exit status

The problem is I don't get it when I compile it locally - it runs fine. Can anyone give me some advice as to what the problem is here?? Thanks!

PS: math.h has been included.


Try linking your program with the math library by using the -lm flag:

gcc -o prg -lm prg.c
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号