Expected but Found erreurs

Beta Testing discussion on mikroC PRO for PIC.
Post Reply
Author
Message
bachirDraria
Posts: 1
Joined: 29 May 2021 09:10

Expected but Found erreurs

#1 Post by bachirDraria » 22 Jun 2021 09:02

SVP, aidez moi à résoudre ce problème :
PIC18F45k22

unsigned short read_ds1307(unsigned short address)
{
unsigned short read_data;
I2C1_Start();
I2C1_Wr(0xD0);
I2C1_Wr(address);
I2C1_Repeated_Start();
I2C1_Wr(0xD1);
read_data=I2C1_Rd(0);
I2C1_Stop();
return(read_data);
}

void write_ds1307(unsigned short adress,unsigned short write_data)
{
I2C1_Start();
I2C1_Wr(0xD0);
I2C1_Wr(adress);
I2C1_Stop();
}

unsigned int digit=0;
unsigned char display10,display1,display20,display2,display30,display3;

int16 z[13]={0,31,59,60,91,121,152,182,213,244,274,305,335};
============================================================

Quand je compile les erreurs suivantes apparaissent :

26 402 ; expected, but 'z' found PIC18F45K22.c
26 402 ; expected, but '=' found PIC18F45K22.c
26 393 'z' Identifier redefined PIC18F45K22.c
26 371 Specifier needed PIC18F45K22.c
26 396 Invalid declarator expected'(' or identifier PIC18F45K22.c

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: Expected but Found erreurs

#2 Post by filip » 22 Jun 2021 14:18

Hi,

int16 is not declared as a type, you may use int16_t instead but put this at the top of the main source file :

Code: Select all

#include <stdint.h>
Also, z is declared in the definition file of the MCU, use some other identifier, e.g. zz.

Regards,
Filip.

Post Reply

Return to “mikroC PRO for PIC Beta Testing”