Searching \ for '[PIC] MPLINK can't find main in ./c018i.o' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=pic
Search entire site for: 'MPLINK can't find main in ./c018i.o'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] MPLINK can't find main in ./c018i.o'
2006\03\17@122006 by Harold Hallikainen

face picon face
I recently upgraded to C18 v3.02. Most projects seem to be compiling fine,
but one that uses an 18f2520 gives the error message below. Any ideas?

THANKS!

Harold


MPLAB C18 v3.02
Executing: "C:\mcc18\bin\mplink.exe" /l"C:\mcc18\lib"
"C:\mcc18\lkr\18f2520i.lkr"

MPLINK 4.02, Linker
Copyright (c) 2006 Microchip Technology Inc.
Error - could not find definition of symbol 'main' in file './c018i.o'.
Errors    : 1




--
FCC Rules Updated Daily at http://www.hallikainen.com

2006\03\17@161146 by James Humes

picon face
You've probably already tried this but have you tried going to project/build
options/project and telling it where your linker scripts and include files
are?  I'm using C18 3.02 w/ the 18F2520 also.



>
> MPLAB C18 v3.02
> Executing: "C:\mcc18\bin\mplink.exe" /l"C:\mcc18\lib"
> "C:\mcc18\lkr\18f2520i.lkr"
>
> MPLINK 4.02, Linker
> Copyright (c) 2006 Microchip Technology Inc.
> Error - could not find definition of symbol 'main' in file './c018i.o'.
> Errors    : 1
>

2006\03\17@233817 by Harold Hallikainen

face picon face
My include path is set to
c:\mcc18\h

libdir is
C:\mcc18\lib

lkrdir is
C:\mcc18\lkr

Still getting the same error.

Thanks for the ideas! Any more?

Harold





{Quote hidden}

> -

2006\03\18@001148 by Xiaofan Chen

face picon face
On 3/18/06, Harold Hallikainen <spam_OUTharoldTakeThisOuTspamhallikainen.com> wrote:
>
> MPLINK 4.02, Linker
> Copyright (c) 2006 Microchip Technology Inc.
> Error - could not find definition of symbol 'main' in file './c018i.o'.
> Errors    : 1
>

Just a guess: maybe you do not have a main() function in your program.
Or maybe that "main" is not spelled all lower case.

Regards,
Xiaofan

2006\03\22@111340 by Info

flavicon
face
I just had a simular problem with mC18. I think you need to recomplile
the c018i.c -file.


{Quote hidden}

2006\03\22@111520 by Info

flavicon
face
Yeah, those doesnt seem to matter... I had to move the file
to the project directory along with some linker files etc.
Not pretty, but it works now. :-/

{Quote hidden}

2006\03\22@114036 by Harold Hallikainen

face picon face
Not finding main was probably because I added -v to the end of the
compiler command line so I could see the version number. Turns out that
none of the .o files were being created. So, I got rid of that (going back
to the default command line), and then the problem was the linker not
finding FPFLAGS. That turned out to be a change in the c18i (or whatever
it's called, the startup code). I was using my own version of it (in my
project directory) to change the start address since I'm running a boot
loader. Copied the new version that was distributed with the C18 update
over to my project directory, modified the start address, and all is well!

Harold



{Quote hidden}

> -

More... (looser matching)
- Last day of these posts
- In 2006 , 2007 only
- Today
- New search...