Public bug reported:
Binary package hint: gcc
While compiling a simple C program, found in Shuam outline series I got these
error messages. Laterly I found that it is related to header files. I am
relatively naive person in programming, please, forgive me for any mistake in
communicating the problem precisely. The error message is here with pasted for
your reference.
I am using ubuntu 8.04 LTS and version of gcc is not known. But one thing I
can tell for sure. I am using the same version of gcc which is given in 8.04
LTS.
This is the program.
#include<stdio.h>
int main () {
char name[20];
float score1, score2, score3, avg;
printf ("Please Enter your name:\n");
scanf ("%[^]s", name);
printf ("Please enter you first score: ");
scanf ("%f", &score1);
printf ("Please enter you second score: ");
scanf ("%f", &score2);
printf ("Please enter you third score: ");
scanf ("%f", &score3);
avg = score1 + score2 + score3 / 3;
printf ("\n\n Name: %sn\n", name);
printf ("score1: %-5.1f\n", score1);
printf ("score2: %-5.1f\n", score2);
printf ("score3: %-5.1f\n\n", score3);
printf ("Average: %-5.1f\n\n", avg);
return 0;
}
The error message is.
[EMAIL PROTECTED]:~/programs/c/Shaums/fourthchapter$ gcc example4.32.c
example4.32.c:2: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before
‘:’ token
In file included from /usr/include/stdio.h:75,
from example4.32.c:6:
/usr/include/libio.h:332: error: expected specifier-qualifier-list before
‘size_t’
/usr/include/libio.h:364: error: expected declaration specifiers or ‘...’
before ‘size_t’
/usr/include/libio.h:373: error: expected declaration specifiers or ‘...’
before ‘size_t’
/usr/include/libio.h:493: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
‘__attribute__’ before ‘_IO_sgetn’
In file included from example4.32.c:6:
/usr/include/stdio.h:312: error: expected declaration specifiers or ‘...’
before ‘size_t’
/usr/include/stdio.h:319: error: expected declaration specifiers or ‘...’
before ‘size_t’
/usr/include/stdio.h:361: error: expected declaration specifiers or ‘...’
before ‘size_t’
/usr/include/stdio.h:363: error: format string argument not a string type
/usr/include/stdio.h:365: error: expected declaration specifiers or ‘...’
before ‘size_t’
/usr/include/stdio.h:678: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
‘__attribute__’ before ‘fread’
/usr/include/stdio.h:684: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
‘__attribute__’ before ‘fwrite’
/usr/include/stdio.h:706: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
‘__attribute__’ before ‘fread_unlocked’
/usr/include/stdio.h:708: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
‘__attribute__’ before ‘fwrite_unlocked’
$
Please help.
Thank you and regards
** Affects: gcc-defaults (Ubuntu)
Importance: Undecided
Status: New
--
gcc header file broken or something.
https://bugs.launchpad.net/bugs/297209
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs