Can't get rid of the error !! :@

THE_RB

Joined Feb 11, 2008
5,438
When people speak a different language and use a translator program (or struggle to use a foreign language themselves) the posts are usually very short, and they can often sound overly-direct or even a bit rude.

What he said was not bad in itself. He expressed a desire to not be wasting time on irrelevant point B but please get back to the posted topic problem ie point A. And he did say please. :)
 

Thread Starter

olvine

Joined Mar 10, 2014
99
To all who are saying about capitalization you are wrong i think...

because in header file's of my under consideration controller it is defined that way...so i m sure i am right about that.
 

Thread Starter

olvine

Joined Mar 10, 2014
99
extern volatile unsigned int TRISC __attribute__((__sfr__));
typedef struct tagTRISCBITS {
unsigned TRISC0:1;
unsigned TRISC1:1;
unsigned TRISC2:1;
unsigned TRISC3:1;
unsigned TRISC4:1;
unsigned TRISC5:1;
unsigned TRISC6:1;
unsigned TRISC7:1;
unsigned TRISC8:1;
unsigned TRISC9:1;
} TRISCBITS;
extern volatile TRISCBITS TRISCbits __attribute__((__sfr__));


The definition in header file..
 

pwdixon

Joined Oct 11, 2012
488
The output given starts with a problem in 'main' but I couldn't find the source code for main, have I missed something?
 

pwdixon

Joined Oct 11, 2012
488
that error is gone now. the first one
These GLCD files look like they were probably pre-existing and I imagine you have used these files in conjunction with your own source for the main. If these were pre-existing library source files then the problem is most likely in your main module so while the reference to the main has somehow been cleared the remaining errors will not be cleared just by looking at the library sources.
 

Thread Starter

olvine

Joined Mar 10, 2014
99
if you see the output image file....you will see that only glcd.c file is not compiling and generating errors where ever '.' operator is used.

I think '.' operator cant b used directly or there would be some configuration before using '.' operator with these PORT and TRIS registers... I am using PIC24FJ64GA004 uC and i cant find anything related to configuration of only one bit.
 

ErnieM

Joined Apr 24, 2011
8,415
The "expected identifier" before the "." is simply "TRISCBITS".

This is defined within the file "p24FJ64GA004.h"

Nowhere within GLCD.txt (which I assume is GLDC.c) is this file #included.

Edit: See t06afre's post below. I believe he is correct as to the captilization. You still need to #include the correct device header file.
 
Last edited:

pwdixon

Joined Oct 11, 2012
488
I'm not coming back to this thread again, you seem to want to make it difficult, if you want help in the future I recommend posting all of your code otherwise I for one certainly won't even read the post.
 

nerdegutta

Joined Dec 15, 2009
2,689
In your compiler output, the first error is at line 22. How I know that? I see the numbers in the error message:

glcd.c:22:11: error expected identifier or '(' before '.' token
I started a new MPLABX project, and copied/pasted your code into it. Then I tried to compile it, and I hoped I got the same error messages as you. And I did. Then I change the first TRISCBITS.TRISC1=0, to TRISCbits.TRISC1=0, and tried to compile it. Then I got an error on the next line. See attachment.

Why don't you try what have been suggested to you?

 

Attachments

Thread Starter

olvine

Joined Mar 10, 2014
99
I am really sorry for that PWDIXON.

@nerdegutta I would try but i am writing code according to uC's header file...I have also copy pasted the definition of TRISC structure. on the previous page....have you seen that ??

check your header file...may be it is defined that way in your header file.
 

t06afre

Joined May 11, 2009
5,934
@Olvine please look here http://www.c4learn.com/c-programming/c-structure-declaration/ and emphasize on way 2
Rich (BB code):
extern volatile TRISCBITS TRISCbits __attribute__((__sfr__));
Here they have declared a variable with name TRISCbits which is of type TRISCBITS. So you can not in any way choose to use TRISCBITS or TRISCbits. Only TRISCbits will be valid to use outside the header file.
 
Last edited:

ErnieM

Joined Apr 24, 2011
8,415
ErnieM If u see 3rd page of the post u'll notice that I have posted the definition of TRISCBITS from p24fj64ga004.h file....

and yes i have included that glcd.h header
And where did you #include p24fj64ga004.h in the glcd.c file?

Huh?
 

Thread Starter

olvine

Joined Mar 10, 2014
99
@ErnieM Is there a need to add p24fj64ga004.h un glcd.c if i include it in glcd.h ?

@t06afre thanks alot :) this was the thing i was missing.

@nurdegutta no prob. Thanks alot for your help.

Attached is the main file too.
 

Attachments

Top