Jan 1, 2003 #1 amiak Programmer Dec 17, 2002 41 US I'm looking for a useful way to use sqrt thanks...
Jan 1, 2003 #2 hnd Programmer Apr 11, 2000 450 DE #include <math.h> .... double a,b; ... a=123.0 b=sqrt(a); .... hnd hasso55@yahoo.com Upvote 0 Downvote
Jan 12, 2003 Thread starter #3 amiak Programmer Dec 17, 2002 41 US this code produces the following error message: /tmp/ccM7zysm.o: In function 'main': /tmp/ccM7zysm.o(.text+0x1c): undefined reference to 'sqrt' I'm running freeBSD 4.5 on an IBM 560. any idea what the problem is? Upvote 0 Downvote
this code produces the following error message: /tmp/ccM7zysm.o: In function 'main': /tmp/ccM7zysm.o(.text+0x1c): undefined reference to 'sqrt' I'm running freeBSD 4.5 on an IBM 560. any idea what the problem is?
Jan 12, 2003 #4 danielhozac Programmer Aug 21, 2001 2,058 SE Maybe you have to link your program with the math library (using -lm or -lmath)? //Daniel Upvote 0 Downvote
Jan 13, 2003 #5 hnd Programmer Apr 11, 2000 450 DE Daniel Bingo! The library must be linked. hnd hasso55@yahoo.com Upvote 0 Downvote