hi every one, i am having a challenge i don't understand...am having this error message " main function is not defined "
error in PIC programming in C. after compiling my code...would be grateful if i can find a solution to this challenge
thanks
Help
- tihomir.losic
- mikroElektronika team
- Posts: 2138
- Joined: 02 Dec 2009 14:16
- Location: Serbia
- Contact:
Re: Help
Hello,
you need to add source file (.c) to your project. Right click on folder "Sources", and then "Add file" (look at attachment): Best regards,
Losic Tihomir
you need to add source file (.c) to your project. Right click on folder "Sources", and then "Add file" (look at attachment): Best regards,
Losic Tihomir
mikroElektronika [Support team]
Re: Help
I am having (I believe) a related problem. When I open a Project using "Recent Projects" (I haven't tried any other way) the source file is not part of the project - I have to add it to the Project every time I open the Project. I tried adding it to the project as is suggested, above, and I tried adding it using the "Add File to Project" button. The outcome is the same either way. I did a Project Save after both methods.
I'm still a relative newbie, so it's probably a "cockpit problem". Ideas?
Regards, EdC
I'm still a relative newbie, so it's probably a "cockpit problem". Ideas?
Regards, EdC
- slavisa.zlatanovic
- mikroElektronika team
- Posts: 1321
- Joined: 07 Apr 2009 09:39
Re: Help
Hi!
I tried to reproduce the issue you're talking about but I couldn't. Everything worked OK both in mikroC PRO for PIC v4.60 and v4.80 BETA.
Please, send me your project, I'll inspect it and suggest further steps.
slavisa.zlatanovic@mikroe.com
I tried to reproduce the issue you're talking about but I couldn't. Everything worked OK both in mikroC PRO for PIC v4.60 and v4.80 BETA.
Please, send me your project, I'll inspect it and suggest further steps.
slavisa.zlatanovic@mikroe.com
Best regards
Slavisa
Slavisa
Re: Help
Hi Slavisa. Thanks.
I am using WinXP (running under VMWare Fusion 3.1.3, on a MacBook Pro running 10.6.7).
Now, a walk-through...
1 - I start mikroC Pro for PIC: it says it is version v.4.60.0.0 at the top, left, corner of the window.
2 - I click Projects>Recent Projects>...\ADC_SIO.mcppi. My Project comes up, including my C source code, ADC_SIO.c, in the editor.
3 - I mouse over to the Project Manager tab, on the right. It opens and says that my project only has two files associated with it: ADC_SIO.hex and ADC_SIO.asm.
4 - I click on Built Current Project, at the top, and the compiler complains that the main function is not defined.
5 - Again, I mouse over to the Project Manager tab, on the right. When It opens, I right-click on Sources and add file ADC_SIO.c.
6 - Again, I click on Built Current Project, at the top, and the compiler is now happy.
7 - I notice that the Save Project button at the top-left is highlighted and I save the project. The Save Project button is now grayed-out.
8 - Now I close out the IDE, restart it, and repeat the process. When I get to step 3, the C source is still not there, and when I get to step 4, the compiler still complains.
I am using WinXP (running under VMWare Fusion 3.1.3, on a MacBook Pro running 10.6.7).
Now, a walk-through...
1 - I start mikroC Pro for PIC: it says it is version v.4.60.0.0 at the top, left, corner of the window.
2 - I click Projects>Recent Projects>...\ADC_SIO.mcppi. My Project comes up, including my C source code, ADC_SIO.c, in the editor.
3 - I mouse over to the Project Manager tab, on the right. It opens and says that my project only has two files associated with it: ADC_SIO.hex and ADC_SIO.asm.
4 - I click on Built Current Project, at the top, and the compiler complains that the main function is not defined.
5 - Again, I mouse over to the Project Manager tab, on the right. When It opens, I right-click on Sources and add file ADC_SIO.c.
6 - Again, I click on Built Current Project, at the top, and the compiler is now happy.
7 - I notice that the Save Project button at the top-left is highlighted and I save the project. The Save Project button is now grayed-out.
8 - Now I close out the IDE, restart it, and repeat the process. When I get to step 3, the C source is still not there, and when I get to step 4, the compiler still complains.
- slavisa.zlatanovic
- mikroElektronika team
- Posts: 1321
- Joined: 07 Apr 2009 09:39
Re: Help
Hi!
If you have the same problems when working on the PC with XP OS, please, contact me again.
Unfortunately, I can not recreate the same testing conditions so I can try to reproduce your problem.I am using WinXP (running under VMWare Fusion 3.1.3, on a MacBook Pro running 10.6.7).
If you have the same problems when working on the PC with XP OS, please, contact me again.
Best regards
Slavisa
Slavisa