I'll have a go at this, though I'm sure Grant or Steve will also throw in on the matter with much more authoritative answers.

printf relies on putchar to actually write the character string out to the UART. printf doesn't know which UART you want it to be directed to, so it just directly reference putchar and expects you to provide putchar to output them. If you've setup a simple polled serial port driver then it should be as simple as having
void putchar(int c)
{    uart_tx(c);
}

or something like that. I can't remember if putchar is defined with an int argument or just a char. Experimentation would tell you

As for sqrt, are you linking in the math library?  -lm
The same might apply to sin, though I might actually be wrong on both of these.

I believe the math functions also require you to compile against the math header file math.h..


Bevan


Hi,

I keep getting these error messages: "undefined reference to ...."
When I try to use printf, it's undefined reference to putchar.
When I use sqrt, it's undefined reference to sqrt.
When I use sin, it's undefined reference to r2dintcall (???).

Is there a solution, or is this normal? (can't imagine it to be)
Thanks,
Oszkar
------------------------------------------------------------------------

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
------------------------------------------------------------------------

_______________________________________________
Mspgcc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users


Reply via email to