Miscellaneous > Programming & Networking
C Programing in Linux
tazor:
Well, I'm not out of trouble yet.
I've converted a program to gcc, but I'm having touble with the math.h library, I think. This is what is happening when I try to compile:
quote:[tazor@tazor dev]$ gcc EngOCalc.c -o EngOCalc -lncurses
EngOCalc.c: In function `main':
EngOCalc.c:14: warning: return type of `main' is not `int'
/tmp/ccWMnoWD.o: In function `main':
/tmp/ccWMnoWD.o(.text+0x2cf): undefined reference to `sqrt'
/tmp/ccWMnoWD.o(.text+0x2de): undefined reference to `sqrt'
/tmp/ccWMnoWD.o(.text+0x2ed): undefined reference to `sqrt'
/tmp/ccWMnoWD.o(.text+0x341): undefined reference to `sqrt'
/tmp/ccWMnoWD.o(.text+0x350): undefined reference to `sqrt'
collect2: ld returned 1 exit status
--- End quote ---
flap:
You need to link with the math library as well.
gcc EngOCalc.c -o EngOCalc -lncurses -lm
Navigation
[0] Message Index
[*] Previous page
Go to full version