Error : Need Function Definition or Deceleration

Hello All,

I am New to Rabbit and hence to Dynamic C development environment.

I am trying to compile the sample code below , but getting Need function definition and deceleration error / expected ) error! I would really appreciate if someone can help me through this.

#use BL26XX.lib
#use RNET.lib
#use RNET_AIN.lib

#define channel 2
#define gaincode 1;
#define MIN_VALUE 205
#define MAX_VALUE 1843
#define MIN_RANGE -2.50
#define MAX_RANGE 2.50

void main()
{

rn_AinData aindata;
int rc;

brdInit();

rc = rn_anaInCalib(channel, RNSINGLE, gaincode, MIN_VALUE, MIN_RANGE, MAX_VALUE, MAX_RANGE, &aindata); // function to calib rabbit net analog card.

}

1 Like

You accidentally included a semicolon in your macro definition for gaincode. Also note that you should use all-uppercase names for your macros. Since Dynamic C won’t actually compile rn_anaInCalib() until it reaches it in your code, the macros you’re defining end up affecting that compilation. Since the function declaration uses “gaincode” and “channel” as variable names, it will replace them with “1” and “2” respectively and generate a compilation error.


#define gaincode 1;

Should be:


#define GAINCODE 1