I am currently working on a program that includes a special exponential function that calls the log function from with in it. (*the code is below). I am getting the following error:
gcc -c gas.c
gcc gas.o list.o queue.o -o gas.exe
Undefined first referenced
symbol in file
log gas.o
which seems to mean that it is not understanding the log function, however I am certain that the math.h library is inclued. Can there be another reason for this error?
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include "bool.h"
#include "gas.h"
double exponential(double mean)
{
double rnx;
rnx = drand48();
return (mean * -1.0 * log(rnx));
}