Compiler error, Have no idea what I did wrong.
live4321
Posts: 3
Greetings,
I am trying to create a little song on my PropellerBOE. However, I am having trouble with the compiler. Whenever I try to build it, it spits this out at me.
"sand dune.c:99:1672: error: expected '}' before numeric constant"
I've searched everywhere in the code and cannot find where this error is really coming from. As far as I can tell, I have all parentheses, curly braces, and square brackets perfect. One thing that could be a problem is the gigantic arrays I have, but I can't really pinpoint the problem in the code. I have been able to run this code properly with a smaller array, but when I added to the dimension of the array, the compiler didn't like that. I have included my code below. Any help or suggestions would be graciously appreciated.
I am trying to create a little song on my PropellerBOE. However, I am having trouble with the compiler. Whenever I try to build it, it spits this out at me.
"sand dune.c:99:1672: error: expected '}' before numeric constant"
I've searched everywhere in the code and cannot find where this error is really coming from. As far as I can tell, I have all parentheses, curly braces, and square brackets perfect. One thing that could be a problem is the gigantic arrays I have, but I can't really pinpoint the problem in the code. I have been able to run this code properly with a smaller array, but when I added to the dimension of the array, the compiler didn't like that. I have included my code below. Any help or suggestions would be graciously appreciated.
#include "simpletools.h" /************************************************* * Public Constants *************************************************/ #define B0 31 #define C1 33 #define CS1 35 #define D1 37 #define DS1 39 #define E1 41 #define F1 44 #define FS1 46 #define G1 49 #define GS1 52 #define A1 55 #define AS1 58 #define B1 62 #define C2 65 #define CS2 69 #define D2 73 #define DS2 78 #define E2 82 #define F2 87 #define FS2 93 #define G2 98 #define GS2 104 #define A2 110 #define AS2 117 #define B2 123 #define C3 131 #define CS3 139 #define D3 147 #define DS3 156 #define E3 165 #define F3 175 #define FS3 185 #define G3 196 #define GS3 208 #define A3 220 #define AS3 233 #define B3 247 #define C4 262 #define CS4 277 #define D4 294 #define DS4 311 #define E4 330 #define F4 349 #define FS4 370 #define G4 392 #define GS4 415 #define A4 440 #define AS4 466 #define B4 494 #define C5 523 #define CS5 554 #define D5 587 #define DS5 622 #define E5 659 #define F5 698 #define FS5 740 #define G5 784 #define GS5 831 #define A5 880 #define AS5 932 #define B5 988 #define C6 1047 #define CS6 1109 #define D6 1175 #define DS6 1245 #define E6 1319 #define F6 1397 #define FS6 1480 #define G6 1568 #define GS6 1661 #define A6 1760 #define AS6 1865 #define B6 1976 #define C7 2093 #define CS7 2217 #define D7 2349 #define DS7 2489 #define E7 2637 #define F7 2794 #define FS7 2960 #define G7 3136 #define GS7 3322 #define A7 3520 #define AS7 3729 #define B7 3951 #define C8 4186 #define CS8 4435 #define D8 4699 #define DS8 4978 #define no 0 //void square1(void); //void square2(void); int square0Note[] = {DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,E2,no,E2,no,E2,no,E2,no,E2,no,E2,no,E2,no,E2,no,E2,no,E2,no,E2,no,E2,no,E2,no,E2,no,E2,no,E2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,E2,no,E2,no,E2,no,E2,no,E2,no,E2,no,E2,no,E2,no,E2,no,E2,no,E2,no,E2,no,E2,no,E2,no,E2,no,E2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,DS2,no,A1,no,E2,no,A2,no,A2,no,A2,no,A2,no,A1,no,A2,no,B1,no,FS2,no,B2,no,B2,no,B2,no,B2,no,B1,no,B2,no,CS2,no,GS2,no,CS3,no,CS3,no,CS3,no,CS3,no,CS2,no,CS3,no,CS2,no,GS2,no,CS3,no,B2,no,GS2,no,FS2,no,CS2,no,B1,no,CS2,no,GS2,no,CS3,no,CS3,no,CS3,no,CS3,no,CS2,no,CS3,no,CS2,no,GS2,no,CS3,no,B2,no,GS2,no,FS2,no,CS2,no,B1,no,A1,no,E2,no,A2,no,A2,no,A2,no,A2,no,A1,no,A2,no,D2,no,A2,no,D3,no,D3,no,D3,no,D3,no,D2,no,D2,no,DS2,no,AS3,no,DS3,no,DS3,no,DS3,no,DS3,no,AS2,no,DS3,no,GS2,no,GS2,no,GS2,no,GS2,no,FS2,no,FS2,no,DS2,no,DS2,no,E2,no,E2,no,E2,no,E2,no,E2,no,E2,no,E2,no,E2,no,E2,no,E2,no,FS2,no,FS2,no,FS2,no,FS2,no,FS2,no,FS2,no,FS2,no,FS2,no,FS2,no,FS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,D2,no,D2,no,D2,no,D2,no,D2,no,D2,no,D2,no,D2,no,D2,no,D2,no,B1,no,B1,no,B1,no,B1,no,B1,no,B1,no,B1,no,B1,no,B1,no,B1,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,A1,no,A1,no,A1,no,A1,no,A1,no,A1,no,A1,no,A1,no,A1,no,A1,no,B1,no,B1,no,B1,no,B1,no,B1,no,B1,no,B1,no,B1,no,B1,no,B1,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,E2,no,E2,no,E2,no,E2,no,E2,no,E2,no,E2,no,E2,no,E2,no,E2,no,D2,no,D2,no,D2,no,D2,no,D2,no,D2,no,D2,no,D2,no,D2,no,D2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no,CS2,no}; int square0Legnth[] = {3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3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,1,1,1,3,1,3,1,3,1,3,1,3,1,1,1,1,1,3,1,1,1,1,1,3,1,3,1,3,1,3,1,3,1,1,1,1,1,3,1,1,1,1,1,3,1,3,1,3,1,3,1,3,1,1,1,1,1,3,1,1,1,1,1,3,1,3,1,3,1,3,1,3,1,1,1,1,1,3,1,1,1,1,1,3,1,3,1,3,1,3,1,3,1,1,1,1,1,3,1,1,1,1,1,3,1,3,1,3,1,3,1,3,1,1,1,1,1,3,1,1,1,1,1,3,1,3,1 3,1,3,1,3,1,1,1,1,1,3,1,1,1,1,1,3,1,3,1,3,1,3,1,3,1,1,1,1,1,3,1,1,1,1,1,3,1,3,1,3,1,3,1,3,1,1,1,1,1,3,1,1,1,1,1,3,1,3,1,3,1,3,1,3,1,1,1,1,1,3,1,1,1,1,1,3,1,3,1}; int legnth[] = {50,50,34,50,34,50,50,34}; //unsigned int stack1[40 + 25]; //unsigned int stack2[40 + 50]; void main() // Main function { int size0 = sizeof(square0Note)/sizeof(square0Note[0]); int row=0; for(int i=0;i<size0;i++) { freqout(4,legnthMS(square0Legnth[i],row),square0Note[i]); row=square0Legnth[i]+row; } } int legnthMS(int l,int row) { int sum=0; for(int i=0;i<l;i++) { sum = sum + legnth[(i+row) % 8]; } return sum; }
Comments