link error ... pls help

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

link error ... pls help

跳至解决方案
1,791 次查看
bingo23
Contributor I

Hi Everybody,

I'm new to codewarrior and I'm working on energy meter project. I got a reference code for this project and when I compile it I get the following error msg.

 

Link Error   : Undefined : "main"
Referenced from "_startup" in

Link failed.

 

What does this error msg mean and how do I solve it?

I'm using the codewarrior version 6.3. But the actual project was done in an older version. Could that be the reason for the error.

标签 (1)
0 项奖励
回复
1 解答
1,191 次查看
Lundin
Senior Contributor IV

It means that the linker can't find a function named main() in your program. "Startup" is the CW default code that gets executed after MCU reset, and it calls main().

在原帖中查看解决方案

0 项奖励
回复
3 回复数
1,192 次查看
Lundin
Senior Contributor IV

It means that the linker can't find a function named main() in your program. "Startup" is the CW default code that gets executed after MCU reset, and it calls main().

0 项奖励
回复
1,191 次查看
bingo23
Contributor I

Thanks for the quick reply.

Ive checked the code and the main() fn is defined. Then why is this error still occurring?

0 项奖励
回复
1,191 次查看
bingo23
Contributor I

oh sorry ... you were right. It was because the startup was calling Main() and the ref code was using main().

 

thanks a lot

0 项奖励
回复