HC12: Link Error

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

HC12: Link Error

跳至解决方案
2,974 次查看
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

标签 (1)
标记 (1)
0 项奖励
回复
1 解答
1,655 次查看
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 项奖励
回复
3 回复数
1,655 次查看
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 项奖励
回复
1,656 次查看
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 项奖励
回复
1,655 次查看
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