Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Thread

gcc problem

gcc problem

2008-02-28 by Tom

I am using avrgcc 4.2.1 through AVRStudio 4.13 Service Pack 1. 

I am getting a frustrating compiler error:

in line 38:


main (

I am getting:

error: unexpected '=', ' ,' , ', ' , ';',  'asm' or '_attribute_" before 
'{' token


Problem is the only lines prior to this line  in the code are comments 
and two includes, explicitly:


#include <stdint.h>
#include <string.h>


   So, am I to assume there is an error in one of these two include files?

   This is my first attempt at using C on an AVR, and I am flummoxed.


avrFreak

Re: [AVR-Chat] gcc problem

2008-02-28 by Tom

Tom wrote:
>
> I am using avrgcc 4.2.1 through AVRStudio 4.13 Service Pack 1.
>
> I am getting a frustrating compiler error:
>
> in line 38:
>
> main (
>
   Err, typo:   main {



avrfreak

RE: [AVR-Chat] gcc problem

2008-02-28 by Philippe Habib

Is it because you've got a paren instead of a curly brace after main?
Show quoted textHide quoted text
-----Original Message-----
From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On Behalf
Of Tom
Sent: Wednesday, February 27, 2008 7:12 PM
To: AVR-Chat@yahoogroups.com
Subject: [AVR-Chat] gcc problem

I am using avrgcc 4.2.1 through AVRStudio 4.13 Service Pack 1. 

I am getting a frustrating compiler error:

in line 38:


main (

I am getting:

error: unexpected '=', ' ,' , ', ' , ';',  'asm' or '_attribute_" before 
'{' token


Problem is the only lines prior to this line  in the code are comments 
and two includes, explicitly:


#include <stdint.h>
#include <string.h>


   So, am I to assume there is an error in one of these two include files?

   This is my first attempt at using C on an AVR, and I am flummoxed.


avrFreak



 
Yahoo! Groups Links






-- 
No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.516 / Virus Database: 269.21.1/1302 - Release Date: 2/27/2008
4:34 PM

Re: [AVR-Chat] gcc problem

2008-02-28 by Tom

Tom wrote:
>
> I am using avrgcc 4.2.1 through AVRStudio 4.13 Service Pack 1.
>
> I am getting a frustrating compiler error:
>
>

   Found it!    It's been 7 years since I coded any C.    I had "main 
{"  not "main () {"



*sheesh* the error the compiler was tossinfg didn't help at ALL.,


avrFreak

RE: [AVR-Chat] gcc problem

2008-02-28 by Philippe Habib

That's what I don't like about gcc.  I don't find the errors to be that
helpful and often the error is unrelated to the problem and a hundred lines
away.
Show quoted textHide quoted text
-----Original Message-----
From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On Behalf
Of Tom
Sent: Wednesday, February 27, 2008 7:54 PM
To: AVR-Chat@yahoogroups.com
Subject: Re: [AVR-Chat] gcc problem

Tom wrote:
>
> I am using avrgcc 4.2.1 through AVRStudio 4.13 Service Pack 1.
>
> I am getting a frustrating compiler error:
>
>

   Found it!    It's been 7 years since I coded any C.    I had "main 
{"  not "main () {"



*sheesh* the error the compiler was tossinfg didn't help at ALL.,


avrFreak




 
Yahoo! Groups Links






-- 
No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.516 / Virus Database: 269.21.1/1302 - Release Date: 2/27/2008
4:34 PM

Re: [AVR-Chat] gcc problem

2008-02-28 by Tom

Philippe Habib wrote:
>
> That's what I don't like about gcc. I don't find the errors to be that
> helpful and often the error is unrelated to the problem and a hundred 
> lines
> away.
>
Phillipe:   to be fair, I have found that to be true with every C 
compiler, indeed, with
every compiler of ANY ilk, I have ever used.  Some are better than others.

At least I haven't paid hundreds or even thousands of dollars for this one!


avrFreak

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.