Generic error in MPLAB

Hey, all. Thanks in advance for the help!

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.

First suspect would be your MPLAB project’s Include path where it’s told to find all the .h files.

Project -> Build Options… -> Project

Based on your messages Include Path should be
C:\mcc18\h

main.c:15:Error [1027] unable to locate 'ifi_aliases.h;
#include

Do you have something that looks like

#include 'ifi_aliases.h;
#include ‘something else’

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.

nope, I copied and pasted that directly from the code…

unfortunately, I do not have access to the laptop until Monday… so It looks like I will be getting back to you guys then! Thanks for your help.

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).

NASA said a hyphen was missing.
http://nssdc.gsfc.nasa.gov/nmc/masterCatalog.do?sc=MARIN1

Wikipedia says Clakre’s mention of it is in “The Promise of Space” 1968, page 225.

The comment in this article says a semicolon error (C vs shell) brought down Ariane 501.
http://praxis101.com/blog/2006/01/ariane-501-one-of-historys-wor.html

That’s the book! And I should correct myself: It’s not exactly one of his “early” books. It did hook me on space after reading 2001.

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.

And also feel free to ask questions here… :wink:

OKAY Update.

Oddly, one of my programmers (a rookie like most of us here) went in and randomly deleted one of the quotation marks in the code as you all suspected.

Old error is gone! Only to let another surface…

now, I get:

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:\working\main.c:14:Error: syntax error
Halting build on first failure as requested.
BUILD FAILED: Mon Dec 01 09:45:22 2008

I am guessing that the build settings are off, due to the fact that I am getting a message that says “DONT_USE”. haha

Any Ideas how to fix this?

…Oh, and the first 21 lines of my code read:

/*******************************************************************************

  • FILE NAME: main.c <FRC VERSION>
  • DESCRIPTION:
  • This file contains the main program loop.
  • USAGE:
  • You should not need to modify this file.
  • Note the different loop speed for the two routines:
  • Process_Data_From_Master_uP
    
  • Process_Data_From_Local_IO
    

*******************************************************************************/

#include “ifi_aliases.h”;
#include “ifi_default.h”;
#include “ifi_utilities.h”;
#include “user_routines.h”;

tx_data_record txdata; /* DO NOT CHANGE! /
rx_data_record rxdata; /
DO NOT CHANGE! /
packed_struct statusflag; /
DO NOT CHANGE! */

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. :wink: 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.

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-

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

-Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- -mL -nw=2066 -D_FRC_BOARD

Come to think of it, I think Alan told me those last two, many moons ago. Thanks again, Alan.