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

Error[70] - No MAIN() function found

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







Error[70] - No MAIN() function found
PostPosted: Thu Jan 13, 2005 11:28 am     Reply with quote

I am trying to compile a simple project using MPLAB v7.00 and PCM version 3.212. This project consists of 2 c files main.c and simplefunc.c
and one header file simplefunc.h

here is my main.c code


/* main.c */

#include <12C671.h>
#include "simplefunc.h"


void main()
{
simple_func();
return;
}


here is the fimplefunc.h header file

/* simplefunc.h */
#ifndef __SIMPLE_FUNC_H__
#define __SIMPLE_FUNC_H__
void simple_func();
#endif


and here is the simplefunc.c file


/* simplefunc.c */
#include <12C671.h>
#include "simplefunc.h"


void simple_func()
{
int i = 0;
i = i * 1000;
return;
}


Now when I compile the code generates ERROR[70] and gripes that simplefunc.c doesn't have a main() function. How do I get around this error, does one need to include all additional c files in main.c files?

Any help would be greatly appreciated.
JD
dyeatman



Joined: 06 Sep 2003
Posts: 1924
Location: Norman, OK

View user's profile Send private message

PostPosted: Thu Jan 13, 2005 11:32 am     Reply with quote

JD,
Yes, you must "include" all files that will be used. This compiler does not have a linker...
Darren Rook



Joined: 06 Sep 2003
Posts: 287
Location: Milwaukee, WI

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

PostPosted: Thu Jan 13, 2005 11:49 am     Reply with quote

Also,

in MPLAB you can only have 1 C file in the Source File pane. If you have more than 1 it will try to compile each individually and then link them. I am not sure why - I haven't used MPLAB in a while does it still do this with CCS? It would be convenient if you could drop all your .C files in the Source File pane so you have easy access to them....
Guest








PostPosted: Thu Jan 13, 2005 12:02 pm     Reply with quote

Darren Rook wrote:
Also,

in MPLAB you can only have 1 C file in the Source File pane. If you have more than 1 it will try to compile each individually and then link them. I am not sure why - I haven't used MPLAB in a while does it still do this with CCS? It would be convenient if you could drop all your .C files in the Source File pane so you have easy access to them....



Yes I can have more that one .c file but it generates the error when building when it compiles each individual file (as you stated).
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