View Full Version : Errors compiling Kevin's new code (pragmas)
01-22-2008, 03:57 PM
hey guys, trying to compile kevin's code (made changes to default_routines only), getting some errors in MPLAB.
258: warning  Unknown pragma 'tmpdata'
249: Error  Unexpected input folowing 'interrupt'
364: warning  Unknown pragma 'tmpdata'
Can anyone help?
Also, what exactly is a pragma? I've never dealt with them before, so help is greatly appreciated.
PS- If I comment off the three lines that cause errors, it gives me
442: Error  undefined label '_FPFLAGS' in '_startup'
01-22-2008, 04:04 PM
Are you compiling his code for the 3.x compiler with the 2.4 compiler?
01-22-2008, 04:15 PM
That's probably it. I thought we had updated it, but apparently not. I'll post back here if that doesn't fix it.
01-22-2008, 04:57 PM
Okay, that fixed the original issues.
Now however, when it gets to the last linking step (COFF to HEX), it pops up "failed to load file xxxxx.cof."
The COFF file is right there in the folder, and it can find it when it is cleaning up the files when I try to build it again. Any ideas?
Update- After done building, the output screen occasionally returns "Error: bad magic number in Coff file xx/xx/autonomous.o"
01-22-2008, 05:07 PM
On the project check the build options to make sure they are the right paths.
Clean sometimes will get something via a different path that the linker won't see.
01-22-2008, 05:15 PM
The linker and lib paths are the defaults (C:\mcc18\[lib or lkr]). I tried to manually set the output directory to the correct directory, but it changed nothing.
01-22-2008, 05:22 PM
Update- After done building, the output screen occasionally returns "Error: bad magic number in Coff file xx/xx/autonomous.o"If the "magic number" is different across the project it means somewhere you've got a piece of code compiled with the wrong compiler version and the linker gets unhappy. My guess is that you're trying to link everything together with the 3.1 tools, but have the wrong version (i.e., 2.4) of the ifi_frc.lib file.
01-23-2008, 03:58 PM
I downloaded the simple C18 3.0 code from your site, so I assume the ifi_frc file is up to date.
If it helps at all, if I download the hex file that appears (but is definitely not complete) to the bot, all the OI's pwm, realy, and switch lights turn on.
Finally, printf almost always returns one of a few errors, no matter what I'm printing. Any suggestions as to why? Not entirely sure of specific errors, I'll edit if I come across one again.
01-25-2008, 03:15 PM
Sorry, missed the editing window.
Anyways, where can I find the update ifi_frc.lib file? I have ifi_frc_8722.lib and ifi_frc_8520.lib, but no ifi_frc.lib, ifi_frc.lib.
I checked kevin's page, and the ifi robotics page, but couldn't find it.
01-25-2008, 05:36 PM
The numbers in the file correspond to a specific version of the robot controller. The current controller version as of 2006 is 8722, which is the one you want.
In the Library Files area of your project you want the downloaded ifi_frc_8722.lib compiled with C18 3.0+. Also, make sure that your linker script is the 18f8722.lkr.
Hope that helps.
01-25-2008, 10:14 PM
Yes, we are using the 8722 lib and lkr files.
01-31-2008, 12:50 PM
I'm having the same problem with the new default 2008 code. Everything compiles fine, but I keep getting the error that it "Failed to load project.cof". I've made sure that the library and linker include paths were right, and using the correct linker/library versions.
vBulletin® v3.6.4, Copyright ©2000-2013, Jelsoft Enterprises Ltd.