Unformatted text preview: COP 3275 C Language Special Notes #1 1. GCC with math.h If you’re using pow() function of math.h library to do the programming assignment #1, and you tried to use gcc to compile it, like “gcc -Wall poly.c”, you might get this compilation error: “undefined reference to `pow' ”. This error is not about your code, but you have to add “-lm” parameter when you compile, like “gcc -Wall -lm poly.c”. This tells the gcc compiler to link the math library when compile. Otherwise, it won’t find the pow() function. This situation will not be seen when you’re using Visual Studio or Eclipse. 2. Scanf with Eclipse on Windows If you write a program using the printf and scanf functions in eclipse on Windows , it might compile correctly, but when you run it in the eclipse console area, it will not function properly. The scanf might ask for the input before any printf can display some message. After you finished with the input, the printf message will show up, even though it was supposed to come...
View Full Document
- Fall '11
- GCC, GNU Compiler Collection, gcc -Wall poly.c