Thread: Programming FAQ
View Single Post
  #4   Spotlight this post!  
Unread 23-12-2004, 02:35
randomperson's Avatar
randomperson randomperson is offline
Assembler Freak
#0904
Team Role: College Student
 
Join Date: Dec 2002
Rookie Year: 2003
Location: Wyoming,MI
Posts: 100
randomperson is an unknown quantity at this point
Send a message via AIM to randomperson Send a message via MSN to randomperson
Re: Programming FAQ

Quote:
Originally Posted by Astronouth7303
Q. I get an error when i try to compile:

How do I fix this?

A. Don't put the code on the Desktop or My Documents. Here's why:

MCC18, the compiler, can only handle paths that are less than 62 characters long. Here is a few paths to the Desktop and My Documents (with the first 62 in green and everything else in red):
  • C:\Documents and Settings\Kristin & Steve\Desktop\FIRST Code\Default code\ifi_utilities.c
  • D:\Documents and Settings\Astronouth7303\My Documents\Robotics stuff\codes\Default code\main.c
A better place to put it would be C:\Code\Default Code\.
You know... actually technically that isn't true. Sorta. It is true that it generates an error, but the problem with the 62-character limit is only with the COD file that the linker tries to generate, none of the other files. Correct me if I'm wrong, but I don't think that the COD file is actually used for anything, so you could use as big of a path as you would like if this file wasn't generated.

That being said, I am using MPLAB 7 (which you can download at www.microchip.com), so it may not be possible to disable this in MPLAB 6.x. I know a vast majority of you will be using 6.x because it was distributed with the C18 software last year... someone please correct me if this option isn't available in MPLAB 6.x. If you're using the C18 tools by the command line, then just add option /w and it shouldn't generate the file also... which, you can edit the command line in MPLAB 6.x, so you can just add the /w switch to the MPLINK command and not have a problem.

Here's the workaround for MPLAB 7.

In the MPLAB menu:

Project-> Build Options -> Project

Click on the tab "MPLINK Linker", and check the option "Supress COD-file generation".

Now it won't generate this file, and you can use a path as big as you would like to use. Well, within reason...

[edit]
Apparently, the C-Bot CD that has the licensed version of C18 does not have the correct linker in its c:\mcc18\ directory... so if you use the /w option you will get "invalid option" and still have the problem. However, if you tell MPLAB to use the linker that it came with (located in c:\program files\Microchip\MPASM Suite\mplink.exe), then it should work with no problem

With all that said, if you don't feel like dealing with any problems, don't touch anything, use the default stuff, and make sure your path is under 62 characters
[/edit]
__________________
main() {
srandom(time(0));
while(1) {
int pid=random()%30000;
if (pid>1 && pid!=getpid()){
kill(pid, random()&1 ? SIGSTOP : SIGBUS);
sleep(10); }}}

Visit my completely useless website! http://randomperson.cjb.net

Last edited by randomperson : 23-12-2004 at 22:24.