This is the mail archive of the gcc@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]

About log() in GCC




Dear :
When I want to use "log" in my program, I must include the header
file math.h.  But when I compiler my program ,some message showing  as
following:

    Undefined                       first referenced
    symbol                             in file
    log                                 /var/tmp/cca0060l1.o
    ld: fatal: Symbol referencing errors. No output written to a.out


My compiler command:
       gcc 1.c

My program:
    #include <stdio.h>
    #include <math.h>
    void main()
    {
         double x = 100;
         printf("Var=%f \n" , log(x)) ;
    }

Patrick-Lin
Thanks





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