I am having problems linking applications using gcc.
If I compile a source file as:
gcc -O3 -c fin.o -o fin.c
and then link as
gcc -o financial fin.o
everything works fine. If however, I compile as:
gcc -g -c fin.c -o fin.o
and then link exactly as above, I get the error message:
undefined reference to 'pow'
or
undefined reference to 'log'
Yes I have included <math.h> - there are NO CHANGES to the source file between
the two compiles. - I ONLY executed "rm -f *.o" to force the rec-compilation
and linking from the "Makefile"
Is this a bug in gcc compiler, gcc linker, missing libraries (my guess) or
what? Has this happened to anybody else? If so have you solved the problem?
Does anybody know what is happening here or what I am doing wrong