Originally Posted by
whiteflags
Why do you care?
I already told you . it is a truth that he is making into a lie. Then is accusing me of being the one that is spreading falsehoods. know you not a deceiver when you see one or hear one?
That's fine, a doubt is better than an assurance that you're correct in general.
Because you don't need to link -lm at all.
you are Wrong, YES I DO!
LOOK SEE. notice the non use of -lm
Code:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main(int argc, char **argv) {
if (argc != 2) {
fprintf(stderr, "Usage: sqrt VALUE\n");
exit(EXIT_FAILURE);
}
printf("%lf\n", sqrt(atof(argv[1])));
return 0;
}
// errors
gcc -Wall -Wextra -pedantic -o "term2" "term2.c" (in directory: /home/userx/bin)
/tmp/ccy45lIM.o: In function `main':
term2.c:(.text+0x51): undefined reference to `sqrt'
collect2: error: ld returned 1 exit status
Compilation failed.
it now seems you've taken on this personal vendetta against me as well.
are you too having a hard time accepting the fact that that I am right about what I stated. MAY means what and SHALL means what?
You probably won't need to explicitly, even when you use math functions. This doesn't mean that in general, you can put -l commands anywhere and expect them to work.
what a ridiculous statement, even If I didn't work.. then what? duh if it don't work one way try something different. how hard is that?
BUT it does work so why fix it if it is not broke? it works for the very same reason I pointed out in the Manual. Key words
Because it's a technicality. I would rather not get by on technicalities like this. It just leads to annoying linker errors to fix when my assumptions are wrong.
You have a smart mouth, doctor.
Thank you!!!!!
well that is you,, and I am me, and it works. I am not that ridged in my thinking or (that) insecure in my ways.
and, actually being called a smart ass, or a smart mouth as you put it, is a complement.
think about it. if you cannot figure that one out, I'll tell you if you really want to know why.