So, I have been trying to install MPLAB on our team’s new programming laptop. UNFORTUNATELY, (Having only the documentation that comes with the CD) I have hit problem after problem. Most of the problems were easy to fix, but It seems that I have hit an error that I cannot repair.
Well, Everything is installed. So, I decided that I would try and build some code that is known to be working. However, upon my attempt to build the code, I was prompted with the error message:
Clean: Deleting intermediary and output files.
Clean: Done.
Executing: “C:\mcc18\bin\mcc18.exe” -p=18F8722 “main.c” -fo=“main.o” -D_FRC_BOARD -D_LARGE_CODE -D_DONT_USE_TMR0 -mL -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa-
C:\Documents and Settings\Administrator.LENOVOGHOST\Desktop\Code\working\main.c:15:Error [1027] unable to locate 'ifi_aliases.h; #include ’
Halting build on first failure as requested.
BUILD FAILED: Tue Nov 25 09:07:58 2008
The file ‘ifi_aliases.h’ exists but it refuses to recognize it. Any help would be greatly appreciated.
In your code? That’s what it looks like, you forgot a ’ . Also, you don’t put semicolons at the end of include directives. Probably just a typo, though.
My first thought was having the files on your desktop. MPLAB, or at least parts of it, doesn’t like command lines longer than 64 characters. But looking over the error, I’m going with rfrank’s answer:
Error [1027] unable to locate 'ifi_aliases.h; #include ’
#include 'ifi_aliases.h;
should be
#include ‘ifi_aliases.h’ //note the ’ at the end
Also, is it a single quote or should it be a double quote? Looking at our old programs I’m thinking how out of shape I am – I haven’t done any robot programming since last spring! Time to start programming again!
Y’know, a single missing character once brought down an unmanned rocket. (Haven’t found an online source for this, but I think I originally saw it in an early Arthur C. Clarke book.)
It was Mariner 1 launched Aug, 1962. I was taking my first programming course when the news of the cause of the failure started coming out. I remember it well (or as well as you can remember 40+ years ago).
First off, you path is too long and will cause issues with the Linker (IIRC).
Second, the PIC MCC18 compiler follows the ANSI C Standard fairly well. ANSI C, supports the Double Quote (e.g. " ) for bounding Include File Names that are in your Source Code directory, and the Less Than and Greater Than (e.g. < and > ) for bounding Include File Names that are in Compiler’s Include Path.
That is why Include File Names like stdio.h and stdlib.h are Bounded with < and > and Include File Names like ifi_aliases.h and are Bounded with ".
/*******************************************************************************
* FILE NAME: ifi_utilities.c
*
* DESCRIPTION:
* This file contains some useful functions that you can call in your program.
*
* USAGE:
* The user should NOT modify this file, so that if a new version is released
* by Innovation First then it can be easily replaced.
* The user should add their own functions to either user_routines.c or another
* custom file.
*
*******************************************************************************/
#include <usart.h>
#include <spi.h>
#include <adc.h>
#include <capture.h>
#include <timers.h>
#include <string.h>
#include <pwm.h>
#include "delays.h" /*defined locally*/
#include "ifi_aliases.h"
#include "ifi_default.h"
#include "ifi_utilities.h"
#include "user_routines.h"
/* Rest of file ifi_utilities.c, goes here */
The MCC18 Compiler, might support the Single Quote (e.g. ’ ) for bounding Include File Names, but that would be non ANSI Standard.
Also, move the Source Directory, “C:\Code\working\main.c” sounds like a good place to me.
When something is not compiling, look at other files that do compile and see how they are different than you code.
The error is on line # 14, there are no Semicolons at the end of the #include lines. Look at the #include lines from my previous post, of the code from the ifi_utilities.c file. If you fix Line #14, the error will move to Line #15 and so on.
DO THIS
#include "ifi_aliases.h"
#include "ifi_default.h"
#include "ifi_utilities.h"
#include "user_routines.h"
VERSES THIS
#include "ifi_aliases.h"; // #14
#include "ifi_default.h"; // #15
#include "ifi_utilities.h"; // #16
#include "user_routines.h"; // #17
I didn’t pay enough attention to this when I first saw it. The initial diagnoses of the extraneous semicolon were correct, so far as they went. However, there’s a more fundamental problem here that I just noticed:
Why did someone edit the main.c file in the first place? User code typically doesn’t go there; it goes in other files. If you can’t understand the error messages immediately, you really shouldn’t be messing with the code in that file. It contains a clear warning right at the top: You should not need to modify this file.
I’m also a little worried by your description of a rookie programmer “randomly deleting” a character. C programming should not be done by trial and error. rfrank gave you exactly the answer you needed in order to correct the problem, and Roger confirmed it. Rather than following their advice, however, you instead tried something “randomly” and got a new error – but one that is also addressed by the original answer. Next time you ask for help, it would probably be more productive for you to pay closer attention to the responses.
I’m still too mellow from turkey to give you the same lecture Alan just gave you, so I’ll just tell you to look at kevin.org/frc/ – the pre-2009 code is all there. Look at what Kevin has as a starting point, “compare and contrast”, “exercise is left for the student” and all. I’m going to take a guess and say look at 2007 FRC code – Kevin greatly changed and simplified the 2008 code and probably wrote something in the header saying as much.
The two -D’s that are bolded I’ve never seen before. Looking at page 95 of Kevin’s link C18_3.0_users_guide.pdf (page 104 of the PDF) show them to be for macros in one of your C listings. Do a global search thru your code to find them. I’m guessing that TMR0 is one of the PIC timers; you’ll have to dig deep into PIC18_reference.pdf to read about that. They are not “standard” macros in Kevin’s code. The ones I have are