Go to Post You all are brilliant people. - Andy Baker [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 13-01-2006, 01: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
In Linux, compiler can't find standard headers

I've been trying to get the default code to compile under Linux, but I've run into some trouble. So far, I've mostly been following the advice in this thread. I installed the C18 compiler under WINE, and that appears to have worked. I can't yet use a makefile because I can't get individual files to compile. For example, I tried to get main.c to compile with this command:
Code:
mcc18 main.c -fo=main.o
But I get the following error:
Code:
Microchip MCC C18 Compiler
        Version 0.0+SVN20050725
DEBUG:Using wine /opt/mcc18/bin/mcc18-traditional main.c -fo=main.o  to launch MCC18
fixme:msvcrt:_spawnve :not translating name Z:\opt\mcc18\bin\cpp18 to locate program
C:\first\default_code\ifi_aliases.h:18:Error [1027] unable to locate 'adc.h'
C:\first\default_code\ifi_default.h:13:Error [1027] unable to locate 'p18cxxx.h'
It looks like it can't find the headers in the standard include directory (/opt/mcc18/h). Is there a parameter I need to pass to mcc18 or some modification to the mcc18 script that I need to make in order for this to work?
  #2   Spotlight this post!  
Unread 14-01-2006, 05:52
Ryan M. Ryan M. is offline
Programming User
FRC #1317 (Digital Fusion)
Team Role: Programmer
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Ohio
Posts: 1,508
Ryan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud of
Re: In Linux, compiler can't find standard headers

This thread may help you get it working, but I'm having problems too.

When I try to compile using the stock configure.py, the wrong processor is used and I run into an "Unknown processor" error. I'm currently working on trying to find where the __18F8722 macro is defined. (actually, it defines that for an older processor... that's what it should be.) Does anyone know?
__________________

  #3   Spotlight this post!  
Unread 14-01-2006, 08: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

Quote:
Originally Posted by Ryan M.
This thread may help you get it working, but I'm having problems too.

When I try to compile using the stock configure.py, the wrong processor is used and I run into an "Unknown processor" error. I'm currently working on trying to find where the __18F8722 macro is defined. (actually, it defines that for an older processor... that's what it should be.) Does anyone know?
Yes, like I said, that's the thread I've mostly been using.

If all else fails, I suppose we can just #define that macro inside p18cxxx.h. However, configure.py isn't my only problem; I cannot even compile one source file on its own. If you do this:
Code:
mcc18 main.c -fo=main.o
inside on the default code, does it work for you (i.e., produces a "main.o" object file)?
  #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.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Let's have Linux Robots Next Year! jdong Control System 52 22-08-2005 09:40
printf could not find definition Alex829 Programming 7 27-06-2005 10:04
IMPORTANT regarding the new C Compiler dlavery General Forum 12 14-01-2005 05:05
Where can I find the new C compiler? CompMaster Programming 2 13-01-2005 02:28
Linux C18 compiler? Servo888 Robotics Education and Curriculum 1 13-12-2003 01:27


All times are GMT -5. The time now is 04:35.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi