link error ... pls help

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

link error ... pls help

ソリューションへジャンプ
1,790件の閲覧回数
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,190件の閲覧回数
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,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 件の賞賛
返信
1,190件の閲覧回数
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,190件の閲覧回数
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 件の賞賛
返信