10 years, 9 months ago.  This question has been closed. Reason: Question has been answered

Compiling error in code.

I'm having some problem while compiling my code. Anyone please help me.

/media/uploads/RavneetSingh/testing_error_in_code.png

1 Answer

10 years, 9 months ago.

Hi,

You probably forgot return code between NUM_SAMPLES definition and buffer[] declaration.

#define NUM_SAMPLES 1500
unsigned short buffer[NUM_SAMPLES];

Accepted Answer

Hi mate , I have fixed it. But now it showing me error in lines 16,17 and 18.

posted by Ravneet S 10 Feb 2014

speaker.write_u16(buffer[i]); {

it says statement is unreachable . why is that ?

posted by Ravneet S 10 Feb 2014

Because your for loop doesn't have '{' bracket and doesn't have terminate condition.

int main() { int i; for(i=0;i<NUM_SAMPLES;i++) {
posted by Toyomasa Watarai 10 Feb 2014