HC12: Link Error

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

HC12: Link Error

Jump to solution
2,097 Views
quassia
Contributor I
When I make the program " Helloworld". It always shows linked failed:
C:\.....HC12C\lib\ansibi.lib is undefined.
Why?
I remove lib\ansibi.lib then add it. It still has this problem.
Thanks
 

Message Edited by CrasyCat on 2007-04-13 02:26 PM

Labels (1)
Tags (1)
0 Kudos
1 Solution
778 Views
CompilerGuru
NXP Employee
NXP Employee
The derivative independent ansibi.lib cannot contain SCI code as
this has to be adapted the your actual speeds and SCI port number.
Therefore your have to provide you own TERMIO_Putchar and TERMIO_Init functions.
Have a look at the code in
lib\hc12c\src\termio.c
Adapt TERMIO_Init and call it before using printf.

Daniel

View solution in original post

0 Kudos
3 Replies
778 Views
quassia
Contributor I
My program is:
#include <hidef.h>      /* common defines and macros */
#include <mc9s12a512.h>     /* derivative information */
#include <stdio.h>
#pragma LINK_INFO DERIVATIVE "SampleS12"
void main(void) { 
  printf("Hello World");
}
 
When I complile it shows 1 warnings:
Warning: c1420: Result of function-call is ignored main.c line 11
When I make it shows
Link Error: L1822: Symbol TERMIO_PutChar in file C:\Program Files\Metrowerks\..\HC12c\lib\ansibi.lib
is undefined
Link Error:Link failed
Thanks
0 Kudos
779 Views
CompilerGuru
NXP Employee
NXP Employee
The derivative independent ansibi.lib cannot contain SCI code as
this has to be adapted the your actual speeds and SCI port number.
Therefore your have to provide you own TERMIO_Putchar and TERMIO_Init functions.
Have a look at the code in
lib\hc12c\src\termio.c
Adapt TERMIO_Init and call it before using printf.

Daniel
0 Kudos
778 Views
CompilerGuru
NXP Employee
NXP Employee
Can you copy the exact error message you get?
(Ctrl-C in the message window does work)
The term "undefined" sounds more like it would not find something inside of the ansi lib than it would not find it.
Does it behave the same when you pick another lib?
Daniel