Hey all I am banging my head against the wall over this. My compiler does not let me declare global structures. I am using the lcd.c and I get 100 compiler errors uppon compiling.
I know what the cause of this is because I ran into it when I was using structures in other codes that I developed myself. If you use the following:
Code:
struct test{
int one;
int two;
int three;
}tst_one;
it will give you these errors you are declaring ts_one globally but if you place "tst_one" inside a function declaration and declare it locally then this will alleviate the errors.
I am wondering if it is a problem with the compiler. I have heard that there are some problems with the version I have and I was just wondering if this is one of those problems.
I have version PCM 4.025.
Any help would be appreciated. If you need me to upload code just say so.
Thanks for all your help!!
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
Posted: Sun Mar 28, 2010 1:40 pm
Post a very small test program the shows the problem.
It must be copy-and-paste compilable, with no errors.
Thanks so much for the reply but I think I have figured it out. I was thinking it was a problem with the structure but it was a problem with MPLAB. I had the lcd.c file placed in the source folder instead of the "other" folder. I have a link to a post that has some additional links to how MPLAB works with using multiple source and header files in a program.
Thank you so much for your reply! Oh and for anyone else that sees this post make sure that you have the #include "lcd.c" after all you #include <PICxxxxxx.h> as well as your #fuses and your #use delay commands. This fixed a bunch of errors like the Need #define Error and the undeclared identifier delay_ms and delay_us errors. You must include the lcd.c file after the pic header include declaration so that the #define is issued prior to the lcd.c file include as well as the delay has to be set prior to the include of the lcd.c.
Any other questions please feel free to reply to this post for anyone else having trouble with the lcd.c driver.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum