Need Help: Build/Make Error

I’m not the programmer for the team, but none of them signed up for an account at Chief Delphi – so I’m posting for them.

We get the following error when we try to compile the program using MPLAB…

Executing: “c:\mcc18\bin\mcc18.exe” -p=18F8520 “ifi_startup.c” -fo=“ifi_startup.o” /i"C:\mcc18\h" -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa-
Executing: “c:\mcc18\bin\mcc18.exe” -p=18F8520 “ifi_utilities.c” -fo=“ifi_utilities.o” /i"C:\mcc18\h" -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa-
C:\First\EDU_Default_Code_2003-12-15\ifi_picdefs.h:1288: *** Error - Invalid 18f8520 header file!
error 1 spawning c:\mcc18\bin\cpp18
Halting build on first failure as requested.
BUILD FAILED: Mon Feb 02 15:47:54 2004

We’ve searched and searched and found no-one else referring to this error (probably a stupid mistake). We DO have the include and library directory set up in Project–>Build Options–>Project (C:\mcc18\h and C:\mcc18\lib), it just won’t work =.

Any help would be greatly appreciated!


Greg Zanone and Team 637


Line 1288 is designed to give you an error if the ifi_picdefs.h file has been loaded more than once (BANKED = 1). However, I am not sure how you did it…


Is this the unadulterated EDU default code?

As you can see from the error message, the error you are seeing is due to line 1288 in ifi_picdefs.h. It’s finding that you’ve defined the macro BANKED when you shouldn’t have. As you can see in ifi_defs.h BANKED is defined after this check. It’s unclear how you were able to do this.
Possible explanations include:

  • The files have been corrupted or modified in some way.
  • You built a new project incorrectly or missed a file.
  • You commented out the lines:

#ifndef __ifi_picdefs_h_
#define __ifi_picdefs_h_

AND included ifi_picdefs.h twice in one file.

This is what a successful compile of that default code should look like:

Deleting intermediary files... done.
Executing: "C:\mcc18\bin\mcc18.exe" -p=18F8520 "ifi_utilities.c" -fo="ifi_utilities.o" /i"C:\mcc18\h" -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa-
Executing: "C:\mcc18\bin\mcc18.exe" -p=18F8520 "main.c" -fo="main.o" /i"C:\mcc18\h" -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa-
Executing: "C:\mcc18\bin\mcc18.exe" -p=18F8520 "printf_lib.c" -fo="printf_lib.o" /i"C:\mcc18\h" -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa-
Executing: "C:\mcc18\bin\mcc18.exe" -p=18F8520 "ifi_startup.c" -fo="ifi_startup.o" /i"C:\mcc18\h" -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa-
Executing: "C:\mcc18\bin\mcc18.exe" -p=18F8520 "user_routines.c" -fo="user_routines.o" /i"C:\mcc18\h" -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa-
Executing: "C:\mcc18\bin\mcc18.exe" -p=18F8520 "user_routines_fast.c" -fo="user_routines_fast.o" /i"C:\mcc18\h" -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa-
Executing: "c:\mcc18\bin\mplink.exe" /l"c:\mcc18\lib" "18f8520user.lkr" "C:\FIRST\EDU\EDU_Default_Code_2003-12-15\ifi_utilities.o" "C:\FIRST\EDU\EDU_Default_Code_2003-12-15\main.o" "C:\FIRST\EDU\EDU_Default_Code_2003-12-15\printf_lib.o" "C:\FIRST\EDU\EDU_Default_Code_2003-12-15\ifi_startup.o" "C:\FIRST\EDU\EDU_Default_Code_2003-12-15\user_routines.o" "C:\FIRST\EDU\EDU_Default_Code_2003-12-15\user_routines_fast.o" "C:\FIRST\EDU\EDU_Default_Code_2003-12-15\ifi_library.lib" /m"" /o"EduCode.cof"
MPLINK 3.40, Linker
Copyright (c) 2003 Microchip Technology Inc.
Errors    : 0

MP2COD 3.40, COFF to COD File Converter
Copyright (c) 2003 Microchip Technology Inc.
Errors    : 0

MP2HEX 3.40, COFF to HEX File Converter
Copyright (c) 2003 Microchip Technology Inc.
Errors    : 0

Loaded C:\FIRST\EDU\EDU_Default_Code_2003-12-15\EduCode.cof
BUILD SUCCEEDED: Mon Feb 02 16:26:37 2004

Thanks, I’ll see if this helps after school tomorrow. We’ve been going bonkers trying to figure out what was wrong lol. :ahh:



There’s a more reasonable explaination I brushed over.

You may have defined BANKED somewhere in your code.

#define BANKED 999

#include "ifi_default.h"
#include "ifi_picdefs.h"

would also cause the problem you saw.

This would conflict with the #define BANKED IFI created in ifi_defpics.h.
You have to make sure you don’t declare macros, variables, routines, etc. by the same name used elsewhere. If this is what you did, you’d normally get a duplicate declaration error, but you happened to pick a define that’s used for an error check and got that error message first.

I counted the characters in the path/file name and you should be fine, but just as a possiblilty, you may be exceeding the 64 character limit on the path/file name in some other file. It probably isn’t that, but if all else fails… :slight_smile:

Ok I’m at school now, we tried downloading the files over again, and this time we have a different error:

Executing: "c:\mcc18\bin\mcc18.exe" -p=18F8520 "ifi_startup.c" -fo="ifi_startup.o" /i"C:\mcc18\h" -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa-
Executing: "c:\mcc18\bin\mcc18.exe" -p=18F8520 "ifi_utilities.c" -fo="ifi_utilities.o" /i"C:\mcc18\h" -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa-
Executing: "c:\mcc18\bin\mcc18.exe" -p=18F8520 "main.c" -fo="main.o" /i"C:\mcc18\h" -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa-
Executing: "c:\mcc18\bin\mcc18.exe" -p=18F8520 "printf_lib.c" -fo="printf_lib.o" /i"C:\mcc18\h" -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa-
Executing: "c:\mcc18\bin\mcc18.exe" -p=18F8520 "user_routines.c" -fo="user_routines.o" /i"C:\mcc18\h" -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa-
C:\FIRST 2004\user_routines.c:191:Error: syntax error
Halting build on first failure as requested.
BUILD FAILED: Tue Feb 03 15:42:53 2004

Which points to:


Commenting this line allows us to compile without errors, but this obviously is not the right way to go because errors are not something (visible or not) which we want lol.

We’re seriously having problems considering nothing was changed…

Please read which may help…

This is FRC code, whereas, before you talked about EDU code.
What default code are you using and which controller?
The code looks like the FRC default code.

If you are loading the FRC default code onto the FRC then you might be missing a macro setting in MPLAB.

In MPLAB go to Project -> Build Options… -> Project
Click the “MPLAB C18” tab on the pop-up window that appears.
and see if “_FRC_BOARD” is defined under Macro definitions.

If not, click on “Add” and type in “_FRC_BOARD”, click OK, close the pop-up windows and try building again.

Loaded C:\FIRST 2004\FIRST 2004.cof
BUILD SUCCEEDED: Wed Feb 04 10:54:12 2004

Thanks :slight_smile: :smiley: :smiley:

Team 637