2014-04-01 10:22 AM
Hello everybody, I have a problem in a project, I want to compilate a code, it has worked correctly in another project ( but the another project is not mine), the code is a simple delay. Here is the body of my code.
delay.h:&sharpinclude ''stm32f4xx.h''line 3: void Delay_ms(unsigned long int nCount);line 4: void Delay_us(unsigned long int nCount);delay.c:&sharpinclude ''delay.h''unsigned int D;void Delay_ms(unsigned long int nCount){ D=23999; while(nCount!=0){D--;if(D==0){D=23999;nCount--;}}}void Delay_us(unsigned long int nCount){ D=24; while(nCount!=0){D--;if(D==0){D=24;nCount--;}}}And the MAIN.C code:&sharpinclude ''stm32f4xx.h''&sharpinclude ''stm32f4xx_rcc.h''&sharpinclude ''stm32f4xx_gpio.h''&sharpinclude ''stm32f4xx_tim.h''&sharpinclude ''stm32f4xx_usart.h''&sharpinclude ''stm32f4xx_adc.h''&sharpinclude <stdio.h>&sharpinclude ''delay.h''...void adc_configure(){...}void usart_configure(){...}void GPIO_configure(){...}int main(void) {... ... Delay_us(10); while(1) { Delay_ms(250); ... Delay_ms(250); ... }}My code is very large and have others problems, but Why I have this error? or How I could solve that? read the part about the delay in the build output, because the others error are similar, I have other code, but different project and In that project the code compile without any error :SThanks.Build target 'TFT'compiling Main.C...delay.h(3): error: &sharp130: expected a ''{''MyTFT1963.h(19): warning: &sharp12-D: parsing restarts here after previous syntax errorMyTFT1963.h(20): warning: &sharp177-D: variable ''X'' was declared but never referencedMyTFT1963.h(21): warning: &sharp177-D: variable ''Y'' was declared but never referencedMyTFT1963.h(22): error: &sharp77-D: this declaration has no storage class or type specifierMyTFT1963.h(22): error: &sharp77-D: this declaration has no storage class or type specifierMyTFT1963.h(197): error: &sharp757: variable ''pPoint'' is not a type nameMyTFT1963.h(198): error: &sharp757: variable ''pPoint'' is not a type nameMyTFT1963.h(199): error: &sharp757: variable ''pPoint'' is not a type nameMyTFT1963.h(200): error: &sharp757: variable ''pPoint'' is not a type nameMyTFT1963.h(201): error: &sharp757: variable ''pPoint'' is not a type nameMain.C(149): error: &sharp20: identifier ''myTouch'' is undefinedMain.C(149): error: &sharp20: identifier ''PREC_EXTREME'' is undefinedcompiling AsciiLib.c...AsciiLib.c(4): error: &sharp130: expected a ''{''AsciiLib.c(8): warning: &sharp174-D: expression has no effectAsciiLib.c(8): warning: &sharp174-D: expression has no effectAsciiLib.c(8): warning: &sharp174-D: expression has no effectAsciiLib.c(8): warning: &sharp174-D: expression has no effectAsciiLib.c(8): warning: &sharp174-D: expression has no effectAsciiLib.c(8): warning: &sharp174-D: expression has no effectAsciiLib.c(8): warning: &sharp174-D: expression has no effectAsciiLib.c(8): warning: &sharp174-D: expression has no effectAsciiLib.c(8): warning: &sharp174-D: expression has no effectAsciiLib.c(8): warning: &sharp174-D: expression has no effectAsciiLib.c(8): warning: &sharp174-D: expression has no effectAsciiLib.c(8): warning: &sharp174-D: expression has no effectAsciiLib.c(8): warning: &sharp174-D: expression has no effectAsciiLib.c(8): warning: &sharp174-D: expression has no effectAsciiLib.c(8): warning: &sharp174-D: expression has no effectAsciiLib.c(8): warning: &sharp174-D: expression has no effectAsciiLib.c(8): warning: &sharp174-D: expression has no effectAsciiLib.c(8): warning: &sharp174-D: expression has no effectAsciiLib.c(8): warning: &sharp174-D: expression has no effectAsciiLib.c(8): warning: &sharp174-D: expression has no effectAsciiLib.c(8): warning: &sharp174-D: expression has no effectAsciiLib.c(8): warning: &sharp174-D: expression has no effectAsciiLib.c(8): warning: &sharp174-D: expression has no effectAsciiLib.c(8): warning: &sharp174-D: expression has no effectAsciiLib.c(10): error: &sharp65: expected a '';''AsciiLib.c(10): error: &sharp29: expected an expressionAsciiLib.c(568): warning: &sharp12-D: parsing restarts here after previous syntax errorAsciiLib.c(568): error: &sharp65: expected a '';''AsciiLib.c(1180): error: &sharp20: identifier ''ASCII16x24'' is undefinedAsciiLib.c(1182): error: &sharp247: function ''GetASCIICode6'' has already been definedcompiling delay.c...compiling MyTFT1963.c...delay.h(3): error: &sharp130: expected a ''{''MyTFT1963.h(19): warning: &sharp12-D: parsing restarts here after previous syntax errorMyTFT1963.h(20): warning: &sharp177-D: variable ''X'' was declared but never referencedMyTFT1963.h(21): warning: &sharp177-D: variable ''Y'' was declared but never referencedMyTFT1963.h(22): error: &sharp77-D: this declaration has no storage class or type specifierMyTFT1963.h(22): error: &sharp77-D: this declaration has no storage class or type specifierMyTFT1963.h(197): error: &sharp757: variable ''pPoint'' is not a type nameMyTFT1963.h(198): error: &sharp757: variable ''pPoint'' is not a type nameMyTFT1963.h(199): error: &sharp757: variable ''pPoint'' is not a type nameMyTFT1963.h(200): error: &sharp757: variable ''pPoint'' is not a type nameMyTFT1963.h(201): error: &sharp757: variable ''pPoint'' is not a type nameMyTFT1963.c(140): error: &sharp757: variable ''pPoint'' is not a type nameMyTFT1963.c(191): warning: &sharp223-D: function ''Delay_ms'' declared implicitlyMyTFT1963.c(297): error: &sharp20: identifier ''LCD_REG'' is undefinedMyTFT1963.c(302): error: &sharp20: identifier ''LCD_RAM'' is undefinedMyTFT1963.c(307): error: &sharp20: identifier ''LCD_REG'' is undefinedMyTFT1963.c(308): error: &sharp20: identifier ''LCD_RAM'' is undefinedMyTFT1963.c(355): error: &sharp20: identifier ''LCD_RAM'' is undefinedMyTFT1963.c(968): error: &sharp757: variable ''pPoint'' is not a type nameMyTFT1963.c(986): error: &sharp757: variable ''pPoint'' is not a type nameMyTFT1963.c(989): warning: &sharp174-D: expression has no effectMyTFT1963.c(989): error: &sharp65: expected a '';''MyTFT1963.c(1006): error: &sharp20: identifier ''First'' is undefinedMyTFT1963.c(1010): error: &sharp757: variable ''pPoint'' is not a type nameMyTFT1963.c(1017): error: &sharp757: variable ''pPoint'' is not a type nameMyTFT1963.c(1023): error: &sharp757: variable ''pPoint'' is not a type nameMyTFT1963.c(1028): error: &sharp757: variable ''pPoint'' is not a type nameTarget not created #delay-header-create2014-04-01 10:35 AM
Something amiss in stm32f4xx.h?
''unsigned long int'' also seems a bit of a mouthful Always start with the first error, the other may be a result of the compiler attempting to resynchronize itself.