AnsweredAssumed Answered

Can not link libraries with MC9S12E128

Question asked by Mark Berezny on Mar 22, 2006
Latest reply on Mar 22, 2006 by Mark Berezny
I am having a lot of trouble linking a library to my program.
I am trying to make use of the math.h library, but I can not get access to it.
I am trying to test this using a simple program:
#include <hidef.h>      /* common defines and macros */
#include <mc9s12e128.h>     /* derivative information */
#include <math.h>
#pragma LINK_INFO DERIVATIVE "SampleS12"
double result;
void main(void) {
result = sqrt(4);
 EnableInterrupts;
 for(;:smileywink: {} /* wait forever */
}
At first I thought all you needed was the #include, then found out more needs to be done, and I can't seem to figure it out. I tried adding the math.h file to the libraries folder in the project, I also gave it high priority on the link order. I have been also fooling around with Command line arguments, but I do not know much about them. I have been searching for a solution to this for a long time and can not find it anywhere.
The specific error I get is:
Link Error: L1822 Symbol sqrt in file main.c.o is undefined
Link Error: Link failed
I also attached to this post, the zipped project file if that is needed.
Someone please give me a hand on this, I'm stumped! thank you,
           -mark

Outcomes