Problems with MPLAB

I got the following error when trying to build:

C:\Documents and Settings\donnyb\Desktop\FIRST\Frc\Rev 03\ifi_aliases.h:18: malformed #include directive
error 1 spawning c:\mcc18\bin\cpp18

MPLAB has not been used on this computer yet, but all the files have built correctly on our other computer. So… is it a software problem?

Thanks,
Char.

I think that the problem is that the path is too long. MPLAB has a problem with paths that are more than 32 characters. Try a shorter path.

One problem is your project is too far down in the directory tree. Move FIRST to the top level of your C drive, e.g., “C:\FIRST\Frc\Rev 03”

I just fixed that, now the same error occurs with the new directory

New message, please? Have you tried reinstalling MPLAB? Did you install from the CD included with your Edu Robot/controller? Did you follow the FIRST specific installation instructions? Did you miss installing the C18 compiler?

I’m on Charley’s team. We have not tried reinstalling. We lost the disc that came with the EDU bot kit and transfered the files from one computer to the laptop that we have. The program works on the original computer, but not the laptop. I have no idea whether or not we are missing the C18 compiler.

Do you have a “c:\mcc18” directory? That’s the compiler.

The error you are getting occurs the first time you try to access a file in the mcc18 directory called adc.h

This can occur if it is missing, but also if your MPLAB project is not set-up correctly. You can check under Project->Build Options…->Project to see everything’s set properly.

Include Path c:\mcc18\h
Library Path c:\mcc18\lib

and for good measure under the MPLAB C18 tab is _FRC_BOARD listed under Macro Definitions?

We do have a “c:\mcc18” directory.

Message: “error 1 spawning C:\mcc18\bin\cpp18” after I verified the build options were set properly. I have no idea what this means!

i’m willing to guess it just means that mcc18 didn’t like something you sent it, hence the “malformed #include directive” error - look at line 18 in ifi_aliases.h and see if someone accidentally bumped a key and inserted a character or something.

wait so ur saying u didnt have the mplab cd so you copied the files (the mplab and mcc18) from the other computer where it works :s ?

if so try this … remove the directories and download the MPLAB[30 Megs] and mcc18 (demo)[10 megs] from the microchip website

and install the mplab first and tghen mcc18 … make sure when ur installing mcc18 you check on when it asks you to configure mplab to use this version of mcc18 and stuff …

if you didnt copy the files over and installed them … try removing them from add/remove program and then do a fresh clean installation (as mentioned above)

btw what is the directory path to the files now ?

Check the toolsuite locations.
under Project->Select Language Toolsuite…

Under Toolsuite Contents “MPLAB C18 C Compiler (mcc18.exe)” should be listed.
Click on that line and see that the Location shows “C:\mcc18\bin\mcc18.exe”

We had the exact same problem, same errors and everything. Its turns out its an occasional MPLAB bug where the compiler cannot locate the Language Toolsuite , even if you have it pointing right at it. We actually tried the exact method that McLeod there suggested. Didn’t work. Only solution we found was to back up your source code and uninstall and reinstall MPLAB.

Just curious, what version of MPLAB are each of you using?
We’re running MPLAB 6.4 downloaded from the Microchip site, rather than the 6.3 version shipped with the EDU Bot.

Is there a cpp18 there?

I think it’s more likely that it means that when it encountered the #include directive, and went to spawn cpp18.exe (the preprocessor) it didn’t find it in C:\mcc18\bin where it expected to find it.

The problem occured on our backup PC, while I was updating it. Our main computer for programming had the up - to - date version, but the backup did not.

Incidentally, I discovered another solution. Under “Projects, Build Options, Project.” Click on the General tab. If your Include Directory does not have anything in it, point it at the c:/mcc18/

This worked for us.

There are changes that the installer makes to your PATH environment environment variable. You need to set it the same way that the computer it is working on is set to. To access the path, open a run box and type “msconfg”. Hope that helps. If you need more help with modifying the PATH post. :slight_smile:

Just to add to all this I tried running the newest version of the ide off the web sight on xp and it didn’t work, the version that shipped with the kit worked. Something with either version 6.31 or 6.4 not working with nt based opperating systems.

6.3 works fine on XP and 2k. I don’t think it’s the version.

ps- is there a diference?

Several of the schools I’m working with are using MPLAB 6.4 on XP systems.
There must be some other little quirks, like OS patch level, involved.

find autoexec.bat, and add the following lines to it:

set PATH=“C:\mcc18\bin;%PATH%”
set PATH=“C:\mcc18\mpasm;%PATH%”
set MCC_INCLUDE=“C:\mcc18\h;%MCC_INCLUDE%”

(change the paths to match your copy of mcc18, of course)