link error ... pls help

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

link error ... pls help

Jump to solution
1,008 Views
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.

Labels (1)
0 Kudos
1 Solution
408 Views
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().

View solution in original post

0 Kudos
3 Replies
409 Views
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 Kudos
408 Views
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 Kudos
408 Views
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 Kudos