Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Help: MCC18 - syntax error in .h file with using "extern"

Status
Not open for further replies.

eepty

Full Member level 2
Joined
Oct 21, 2005
Messages
143
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,298
Activity points
2,611
I am using the MAPLAB IDE with the MCC18 compiler, the microcontroller is PIC18F.

The compiler give me a syntax error at line 27 in the .h file when I compile the software, my code is:

myADC.h:
Code:
#ifndef __myADC_H
#define __myADC_H

extern unsigned int room_ADval;	//line 27

#endif

myADC.c:
Code:
#include <p18cxxx.h>
#include "main.h"
#include "myADC.h"
...
unsigned int room_ADval;
...

Please help, I used similar structure with Hi-tech C compiler for PIC16 and no problem found.
 

code looks OK - what was the error message?
could the error be in main.h (in C error messages often appear one or more lines after the actual error)?
try including myADC.h before main.h
 
  • Like
Reactions: eepty

    eepty

    Points: 2
    Helpful Answer Positive Rating
I found what's wrong. I changed to use the Hi-tech comiler to compile, it also give me an error message, but it is clearer, it said I missed a ";". So I go to check "main.h" and found I missed a ";" at the last line. :p

Hey, horace1, you are really cool, that's exactly what you said, although I found it before reading you post, I will give you a thumb up :)
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top