View Single Post
  #4   Spotlight this post!  
Unread 14-01-2006, 10:55
lasindi lasindi is offline
Registered User
FRC #1164 (Project Neo)
Team Role: College Student
 
Join Date: Jan 2004
Rookie Year: 2004
Location: New Mexico
Posts: 11
lasindi is an unknown quantity at this point
Re: In Linux, compiler can't find standard headers

I have a very, very, ugly and cumbersome workaround for the header problem.

If you edit every attempt in the code that includes a mcc18 header (e.g. #include <adc.h>) to include the header from the local directory, it will work. For example, on my computer, mcc18 is installed in ~/.wine/drive_c/mcc18, and the default code is in ~/.wine/drive_c/first/default_code. I created a link in the default code directory with this command:
Code:
ln -s ../../mcc18/h .
and then edited all of the necessary #include directives (e.g., #include "h/adc.h"). What's weird is that apparently the precompiler doesn't even detect when it changes directories, so even in mcc18 headers, if they reference other mcc18 headers, those references must also be edited in exactly the same way. For example, I had to change line 19 in p18cxxx.h to this:
Code:
  #include "h/p18c452.h"
If I do this to every such directive the precompiler encounters, I can compile individual source files. At the moment I'm running into a linker error; I'm going to see if I can fix/understand it better before posting about it.

In any case, if absolutely necessary, changing all these #includes is possible, but if anyone knows of a better solution, please tell me.