Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
15 years ago

[Resolved] Nios II make errors "syntax error" and "already defined"

Hi,

I use Nios II IDE 9.0SP2 (but it is no significant here).

After little modifications on my sources, I had got make errors like this :

--- Quote Start ---

../myproject.c:783: error: invalid initializer

../myproject.c:783: warning: data definition has no type or storage class

../myproject.c:784: error: syntax error before '}' token

../myproject.c:785: warning: type defaults to `int' in declaration of `Write_Config2'

../myproject.c:785: warning: data definition has no type or storage class

../myproject.c:674: error: previous definition of 'tab_config' was here

../myproject.c:886: error: invalid initializer

../myproject.c:886: warning: data definition has no type or storage class

../myproject.c:887: error: syntax error before '(' token

../myproject.c:888: error: syntax error before '(' token

../myproject.c:889: warning: type defaults to `int' in declaration of `Write_Config2'

../myproject.c:889: warning: data definition has no type or storage class

../myproject.c:890: error: syntax error before '}' token

../myproject.c:904: warning: type defaults to `int' in declaration of `temp_mes'

../myproject.c:904: error: variable-size type declared outside of any function

../myproject.c:904: error: variable-sized object may not be initialized

../myproject.c:904: warning: data definition has no type or storage class{standard input}: Assembler messages:

{standard input}:5542: Error: symbol `varxxxxxxx' is already defined

{standard input}:5548: Error: symbol `varyyyyyyy' is already defined

{standard input}:5554: Error: symbol `varzzzzzzz' is already defined

--- Quote End ---

After 3 hours of research, clean, copy from sources, reinstall Nios IDE, test on another computer...

I found that all thoses make errors are just due to a little semicolon ';'

    detect_component = IORD_ALTERA_AVALON_PIO_DATA(DETECTION_PIO_BASE); // I have forgot ';' here
    if (detect_component)
    {
        printf("INFO\t: Detected Component ...\n");
    }

I wrote this post in case of someone is looking for those make errors.

Just a little 7-bit character ! :D

To resume : keep cool and simple. Make backups before modifications:)
No RepliesBe the first to reply