View previous topic :: View next topic |
Author |
Message |
jd Guest
|
Error[70] - No MAIN() function found |
Posted: Thu Jan 13, 2005 11:28 am |
|
|
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: 1937 Location: Norman, OK
|
|
Posted: Thu Jan 13, 2005 11:32 am |
|
|
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
|
|
Posted: Thu Jan 13, 2005 11:49 am |
|
|
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
|
|
Posted: Thu Jan 13, 2005 12:02 pm |
|
|
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). |
|
|
|