Date: Wed, 14 Oct 1998 17:55:40 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: "Benjamin R. Saylor" cc: djgpp AT delorie DOT com Subject: Re: math - undefined references In-Reply-To: <36243765.4497888F@arctic.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com On Tue, 13 Oct 1998, Benjamin R. Saylor wrote: > When I compile my program, I get the message "undefined reference to > sinf." This doesn't happen with sin(), just sinf() (I haven't tried > other *f()'s). I've tried adding -lm to both the start and the end of > the command line as it says in the FAQ, but it doesn't work! What's > going on? The trivial one-liner below compiles fine (and runs) for me when I use the following compilation command line: gcc -Wall -D_USE_LIBM_MATH_H -O -g -o sft sft.c -lm So please post more details, including the exact command line, the version of the compiler, etc. Also try my program, just to be sure this isn't specific to your program. #include #include #include int main (int argc, char **argv) { return printf ("%f\n", sinf(atoi(argv[1]))); }