Jump to content
Sign in to follow this  
FrankGe

Problem With Compiler

Recommended Posts

Hello,

 

Sourceboost 5.8

BoostC 1.9.2

OS: XP sp2

 

A little project with 2 files

 

main.c

--------

#pragma CLOCK_FREQ 20000000

#include <system.h>

#include "main.h"

 

void main()

{

struct DateTime dt;

 

while (1)

{

setDateTime(&dt);

}

}

 

void setDateTime(struct DateTime *date)

{

 

}

 

main.h

--------

#ifndef _structTest_h_

#define _structTest_h_

 

// PCF8583 Clock registers

#define control 0x00

#define hundredths 0x01

#define seconds 0x02

#define minutes 0x03

#define hours 0x04

#define date 0x05

#define months 0x06

#define timer 0x07

#define alarm_ctrl 0x08

#define alarm_hundreds 0x09

#define alarm_seconds 0x0a

#define alarm_minutes 0x0b

#define alarm_hours 0x0c

#define alarm_date 0x0d

#define alarm_month 0x0e

#define alarm_timer 0x0f

#define ramzero 0x10

 

enum WeekDay

{

MO = 1,

TU = 2,

WE = 3,

TH = 4,

FR = 5,

SA = 6,

SU = 7

};

 

struct Date

{

char year;

char month;

char day;

char weekDay;

};

 

struct Time

{

char hour;

char min;

char sec;

char timezone;

};

 

struct DateTime

{

struct Date d;

struct Time t;

};

 

void setDateTime(struct DateTime *date);

 

#endif

 

 

When I try to compile this then I've got this message

 

Compiling...

 

"D:\Program Files\SourceBoost\boostc.pic16.exe" -t PIC16F877A StructTest.c

 

BoostC Optimizing C Compiler Version 1.9.2 Beta (for PIC16 architecture)

http://www.picant.com/c2c/c.html

Copyright© 2004-2005 Pavel Baranov

Copyright© 2004-2005 David Hobday

 

 

structTest.h(56): error: missing right paren

failure

Failed to locate output file 'StructTest.obj'

Done

 

Failed

 

But I think mu code is ok.

 

A strange thing is when I put all the "#define" in comment then there is no error

 

Frank

Share this post


Link to post
Share on other sites

...
#define date           0x05 
...
void setDateTime(struct DateTime *date);
...

 

This is the problem. You define 'date' as a constant and than use it as function argument.

 

Regards,

Pavel

Share this post


Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...