CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

NEWBIE

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Guest








NEWBIE
PostPosted: Thu Dec 08, 2005 6:15 am     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Dec 08, 2005 7:36 am     Reply with quote

above is symptomatic of what is wrong with the internet.

Rolling Eyes

jds-pic
Zaki



Joined: 30 Nov 2005
Posts: 8

View user's profile Send private message

PostPosted: Thu Dec 08, 2005 8:56 am     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Dec 08, 2005 9:53 am     Reply with quote

jds-pic wrote:
above is symptomatic of what is wrong with the internet.

Rolling Eyes

jds-pic


Yeah, I would like to know a little more about this.
_________________
-Matt
DragonPIC



Joined: 11 Nov 2003
Posts: 118

View user's profile Send private message

PostPosted: Thu Dec 08, 2005 10:11 am     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Dec 16, 2005 10:27 am     Reply with quote

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

View user's profile Send private message Send e-mail

Re: NEWBIE
PostPosted: Fri Dec 16, 2005 10:22 pm     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group