View previous topic :: View next topic |
Author |
Message |
Guest
|
NEWBIE |
Posted: Thu Dec 08, 2005 6:15 am |
|
|
I get this error when tryingto compile the .h only of the project .. while there is as well a main function located on another .c file !!!!
Error 70 "C:\Grad Project 1\p18f252.h" Line 272(0,1): No MAIN() function found |
|
|
jds-pic
Joined: 17 Sep 2003 Posts: 205
|
|
Posted: Thu Dec 08, 2005 7:36 am |
|
|
above is symptomatic of what is wrong with the internet.
jds-pic |
|
|
Zaki
Joined: 30 Nov 2005 Posts: 8
|
|
Posted: Thu Dec 08, 2005 8:56 am |
|
|
I dunno what u mean jds .. anyway I am the one who posted the subject .. i tweaked a bit and did some search ..am stuck now with the same problem again but the same cure isnt applicable .. Anyway I have 5 files in the project 1 header file .. i used the default header file for the pic supplied with the software .. Now lets say the main function is located on file X.c
X.c includes Y.c
Y.c includes the header file along with Z.c
Now when compiling i get a no main function error in the Z.c file . And definately no main is supposed to be on that file .
[N.B] Z.c includes the pic header file .. |
|
|
DragonPIC
Joined: 11 Nov 2003 Posts: 118
|
|
Posted: Thu Dec 08, 2005 9:53 am |
|
|
jds-pic wrote: | above is symptomatic of what is wrong with the internet.
jds-pic |
Yeah, I would like to know a little more about this. _________________ -Matt |
|
|
DragonPIC
Joined: 11 Nov 2003 Posts: 118
|
|
Posted: Thu Dec 08, 2005 10:11 am |
|
|
Zaki wrote: | I dunno what u mean jds .. anyway I am the one who posted the subject .. i tweaked a bit and did some search ..am stuck now with the same problem again but the same cure isnt applicable .. Anyway I have 5 files in the project 1 header file .. i used the default header file for the pic supplied with the software .. Now lets say the main function is located on file X.c
X.c includes Y.c
Y.c includes the header file along with Z.c
Now when compiling i get a no main function error in the Z.c file . And definately no main is supposed to be on that file .
[N.B] Z.c includes the pic header file .. |
When you open CCS, open the project file for the project you want to compile. Then compile the project. If you open a file that is not the main project file (same name as the project file with the .c extension) without opening the project, it will try to compile only that file and will look for a main() funtion in that file or another included file. _________________ -Matt |
|
|
DragonPIC
Joined: 11 Nov 2003 Posts: 118
|
|
Posted: Fri Dec 16, 2005 10:27 am |
|
|
I just found out something when trying to do this type of file including when copying and remnaming a project folder or changing the project folders name. You must open your main *.c file and compile it again to make a new project file.
For version control, I copy a rename my folder with a new version name. If I open the project file and choose the "open all project files" button, it opens all the files from the previous project folder. It also uses all these previous files to compile.
Not good when it is writing over previous version files. Also, when I program with ICD using the *.hex file from the new folder, it is actually programming with the old *.hex file. _________________ -Matt |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
Re: NEWBIE |
Posted: Fri Dec 16, 2005 10:22 pm |
|
|
Anonymous wrote: | I get this error when tryingto compile the .h only of the project .. while there is as well a main function located on another .c file !!!!
Error 70 "C:\Grad Project 1\p18f252.h" Line 272(0,1): No MAIN() function found |
And that's your problem. You can't compile individual files with CCS. You must compile only one file that is complete with main(). Other files can be included in the "main" c file but they are not compiled separately since there is no linker. |
|
|
|