This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

error message from GCC


Dear GNU/GCC-Team,

I have a problem with an error message of gcc for LINUX, which I cannot
explain and cannot solve, even after searching in man and info pages for hours
(even days). It occured when I tried to compile a programm of mine.
Step by step I was able to encircle the problem to the following point:

gcc does not seem to know about mathematical functions, although I include
<math.h>. This got on my nerves the whole weekend and now I am sort of
desperate. That is why I write you this mail, because I hope that you can help
me (maybe it is only a missing compiler option...).


I want the following (extremely simple) programm to compile:


#include <stdio.h>
#include <math.h>

int main(void)
{
printf("\nlog(%f)=%f\n",4.7,log(4.7));
return 0;
}



so I input "gcc test.c" at the bash. But I only get the following error:

/tmp/cca001391.o: In function `main':
/tmp/cca001391.o(.text+0xe): undefined reference to `log'



Where is the error? What do I do wrong?
(besides: the same happens, if I want to use another function of <math.h>,
for example pow or log10)

I hope that you can help me or write me where I can get help.

Tobias Richter
manucubus@gmx.de

-- 
Sent through Global Message Exchange - http://www.gmx.net


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]