I write a simple .c file and compile it in my Sesu11.But it has many errors even though it just include a simple printf sentence.I wonder that is it caused by my compile environment is not correct and how to check my environment.Thanks. Here is my C code and the compile result.
[Linux:/si/usr/hrl]vi hello.c
#include <stdio.h>
int main()
{
printf("hello world!");
return 0;
}
[Linux:/si/usr/hrl]gcc -O hello.c -o hello
In file included from /usr/include/stdio.h:37,
from hello.c:1:
/usr/lib64/gcc/x86_64-suse-linux/4.3/include/stddef.h:214: error:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘typedef’
In file included from /usr/include/stdio.h:78,
from hello.c:1:
/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:495: error:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_IO_sgetn’
In file included from hello.c:1:
/usr/include/stdio.h:301: error:expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/stdio.h:307: 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:326: error:expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/stdio.h:368: error:expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/stdio.h:370: error:格式字符串实参不是字符串型
/usr/include/stdio.h:372: error:expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/stdio.h:374: error:格式字符串实参不是字符串型
/usr/include/stdio.h:644: error:expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/stdio.h:647: error:expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/stdio.h:657: error:expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/stdio.h:687: error:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘fread’
/usr/include/stdio.h:693: error:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘fwrite’
/usr/include/stdio.h:715: error:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘fread_unlocked’
/usr/include/stdio.h:717: error:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘fwrite_unlocked’
Your header files appear to be corrupted. Since you are on Suse, I'd recommend that you remove and then reinstall devel_basis
:
zypper remove devel_basis
zypper install devel_basis
You should be fine after that!