CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Included library errors

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
tamagee



Joined: 02 Sep 2009
Posts: 6

View user's profile Send private message

Included library errors
PostPosted: Wed Sep 02, 2009 8:27 pm     Reply with quote

I'm including an included library and the compiler is returning errors:
Code:

#include <18f26j50.h>

#fuses HS, NOWDT, NOPROTECT
#use delay(clock=20000000)
#use rs232(baud=9600, xmit=PIN_B2, rcv=PIN_B1, stream=COM_A)

#use delay(internal=8M)

#include "stdlib.h"
#include "sht51.c"
#include "stdio.h"
#include "input.c"
#include "time.h"


Quote:

** Error 28 "C:\Program Files\PICC\drivers\time.h" Line 97(1,2): Expecting an identifier
*** Error 48 "C:\Program Files\PICC\drivers\time.h" Line 140(9,16): Expecting a (
*** Error 43 "C:\Program Files\PICC\drivers\time.h" Line 140(14,15): Expecting a declaration
*** Error 81 "C:\Program Files\PICC\drivers\time.h" Line 140(19,20): Expecting a basic type
*** Error 48 "C:\Program Files\PICC\drivers\time.h" Line 151(16,23): Expecting a (
*** Error 43 "C:\Program Files\PICC\drivers\time.h" Line 151(27,28): Expecting a declaration

Help?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Sep 02, 2009 10:31 pm     Reply with quote

It's a bug in the 18f26j50.h file. CCS has added a typedef structure
to that file. They have named it 'time_t', but that name is already used
in time.h. That's the reason for the compiler error. The problem is the
name shown in bold below, in 18f26j50.h:
Quote:

// RTC Functions: setup_rtc(), setup_rtc_alarm(), rtc_read(),
// rtc_write(), rtc_alarm_read(), rtc_alarm_write()
// Structure used in read and write functions (pass pointer):
typedef struct {
int8 tm_year;
int8 tm_yday; // Not used by built in functions
int8 tm_mday;
int8 tm_mon;
int8 tm_hour;
int8 tm_wday;
int8 tm_sec;
int8 tm_min;
int8 tm_isdst; // Not used by built in functions
} time_t;

This structure is used in their rtc functions.

You can fix it by editing the 18f26j50.h file. Change the name shown in
bold above to something else, such as:
Code:
rtc_time_t;

This bug affects 29 header files in the J-series PICs. It's in vs. 4.098.
You should email CCS about this bug.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group