0
   //test.c  
#include <stdio.h>
int main() {
    printf("Hello");
    return 0;
}

I am on my Ubuntu 14.04 32 bit Virtual Machine. And I have tried to install gcc-3.(I don't know if I did it completely right.)

But I am getting this error when I try to compile this(test.c) simple program.

gtucpp@ubuntu:~/Desktop$ gcc -o test test.c
In file included from /usr/include/stdio.h:27,
                 from test.c:1:
/usr/include/features.h:374:25: sys/cdefs.h: No such file or directory
/usr/include/features.h:398:23: gnu/stubs.h: No such file or directory
In file included from /usr/include/stdio.h:33,
                 from test.c:1:
/usr/lib/gcc/i486-linux-gnu/3.4.6/include/stddef.h:213: error: syntax error before "typedef"
In file included from test.c:1:
/usr/include/stdio.h:35:25: bits/types.h: No such file or directory
In file included from test.c:1:
/usr/include/stdio.h:48: error: syntax error before "typedef"
/usr/include/stdio.h:53: error: syntax error before "__USING_NAMESPACE_STD"
/usr/include/stdio.h: In function `__USING_NAMESPACE_STD':
/usr/include/stdio.h:64: error: storage class specified for parameter `__FILE'
In file included from /usr/include/_G_config.h:20,
                 from /usr/include/libio.h:31,
                 from /usr/include/stdio.h:74,
                 from test.c:1:
/usr/include/wchar.h:94: error: storage class specified for parameter `__mbstate_t'
In file included from /usr/include/libio.h:31,
                 from /usr/include/stdio.h:74,
                 from test.c:1:
/usr/include/_G_config.h:23: error: syntax error before "__off_t"
/usr/include/_G_config.h:28: error: syntax error before "__off64_t"
In file included from /usr/include/libio.h:49,
                 from /usr/include/stdio.h:74,
                 from test.c:1:
/usr/lib/gcc/i486-linux-gnu/3.4.6/include/stdarg.h:43: error: storage class specified for parameter `__gnuc_va_list'
In file included from /usr/include/stdio.h:74,
                 from test.c:1:
/usr/include/libio.h:154: error: storage class specified for parameter `_IO_lock_t'
/usr/include/libio.h:274: error: syntax error before "__off_t"
/usr/include/libio.h:284: error: syntax error before "_IO_lock_t"
/usr/include/libio.h:312: error: syntax error before '}' token
/usr/include/libio.h:315: error: storage class specified for parameter `_IO_FILE'
/usr/include/libio.h:320: error: storage class specified for parameter `_IO_2_1_stdin_'
/usr/include/libio.h:321: error: storage class specified for parameter `_IO_2_1_stdout_'
/usr/include/libio.h:322: error: storage class specified for parameter `_IO_2_1_stderr_'
/usr/include/libio.h:338: error: storage class specified for parameter `__ssize_t'
/usr/include/libio.h:338: error: syntax error before "__io_read_fn"
/usr/include/libio.h:346: error: storage class specified for parameter `__ssize_t'
/usr/include/libio.h:346: error: redefinition of parameter '__ssize_t'
/usr/include/libio.h:338: error: previous definition of '__ssize_t' was here
/usr/include/libio.h:346: error: syntax error before "__io_write_fn"
/usr/include/libio.h:355: error: syntax error before "__off64_t"
/usr/include/libio.h:355: error: storage class specified for parameter `__io_seek_fn'
/usr/include/libio.h:358: error: storage class specified for parameter `__io_close_fn'
/usr/include/libio.h:390: error: syntax error before '*' token
/usr/include/libio.h:390: error: storage class specified for parameter `__underflow'
/usr/include/libio.h:391: error: syntax error before '*' token
/usr/include/libio.h:391: error: storage class specified for parameter `__uflow'
/usr/include/libio.h:392: error: syntax error before '*' token
/usr/include/libio.h:392: error: storage class specified for parameter `__overflow'
/usr/include/libio.h:434: error: syntax error before '*' token
/usr/include/libio.h:434: error: storage class specified for parameter `_IO_getc'
/usr/include/libio.h:435: error: syntax error before "_IO_FILE"
/usr/include/libio.h:435: error: storage class specified for parameter `_IO_putc'
/usr/include/libio.h:436: error: syntax error before '*' token
/usr/include/libio.h:436: error: storage class specified for parameter `_IO_feof'
/usr/include/libio.h:437: error: syntax error before '*' token
/usr/include/libio.h:437: error: storage class specified for parameter `_IO_ferror'
/usr/include/libio.h:439: error: syntax error before '*' token
/usr/include/libio.h:439: error: storage class specified for parameter `_IO_peekc_locked'
/usr/include/libio.h:445: error: syntax error before '*' token
/usr/include/libio.h:445: error: storage class specified for parameter `_IO_flockfile'
/usr/include/libio.h:446: error: syntax error before '*' token
/usr/include/libio.h:446: error: storage class specified for parameter `_IO_funlockfile'
/usr/include/libio.h:447: error: syntax error before '*' token
/usr/include/libio.h:447: error: storage class specified for parameter `_IO_ftrylockfile'
/usr/include/libio.h:464: error: syntax error before '*' token
/usr/include/libio.h:465: error: storage class specified for parameter `_IO_vfscanf'
/usr/include/libio.h:466: error: syntax error before '*' token
/usr/include/libio.h:467: error: storage class specified for parameter `_IO_vfprintf'
/usr/include/libio.h:468: error: storage class specified for parameter `__ssize_t'
/usr/include/libio.h:468: error: redefinition of parameter '__ssize_t'
/usr/include/libio.h:346: error: previous definition of '__ssize_t' was here
/usr/include/libio.h:468: error: syntax error before "_IO_padn"
e/libio.h:474: error: storage class specified for parameter `_IO_free_backup_area'
In file included from test.c:1:
/usr/include/stdio.h:79: error: storage class specified for parameter `__gnuc_va_list'
/usr/include/stdio.h:79: error: conflicting types for '__gnuc_va_list'
/usr/lib/gcc/i486-linux-gnu/3.4.6/include/stdarg.h:43: error: previous definition of '__gnuc_va_list' was here
/usr/include/stdio.h:79: error: syntax error before "va_list"
/usr/include/stdio.h:90: error: storage class specified for parameter `__off_t'
/usr/include/stdio.h:90: error: syntax error before "off_t"
/usr/include/stdio.h:102: error: storage class specified for parameter `__ssize_t'
/usr/include/stdio.h:102: error: redefinition of parameter '__ssize_t'
/usr/include/libio.h:468: error: previous definition of '__ssize_t' was here
/usr/include/stdio.h:102: error: syntax error before "ssize_t"
/usr/include/stdio.h:164:28: bits/stdio_lim.h: No such file or directory
/usr/include/stdio.h:169: error: storage class specified for parameter `stdout'
/usr/include/stdio.h:170: error: storage class specified for parameter `stderr'
/usr/include/stdio.h:176: error: syntax error before "__BEGIN_NAMESPACE_STD"
/usr/include/stdio.h:180: error: storage class specified for parameter `rename'
/usr/include/stdio.h:180: error: syntax error before "__THROW"
/usr/include/stdio.h:209: error: storage class specified for parameter `tmpnam'
/usr/include/stdio.h:209: error: syntax error before "__THROW"
/usr/include/stdio.h:228: error: storage class specified for parameter `tempnam'
/usr/include/stdio.h:228: error: syntax error before "__THROW"
/usr/include/stdio.h:242: error: storage class specified for parameter `fflush'
/usr/include/stdio.h:243: error: syntax error before "__END_NAMESPACE_STD"
/usr/include/stdio.h:280: error: storage class specified for parameter `freopen'
/usr/include/stdio.h:280: error: syntax error before "__wur"
/usr/include/stdio.h:320: error: storage class specified for parameter `fmemopen'
/usr/include/stdio.h:320: error: syntax error before "__THROW"
/usr/include/stdio.h:325: error: storage class specified for parameter `open_memstream'
/usr/include/stdio.h:325: error: syntax error before "__THROW"
/usr/include/stdio.h:337: error: storage class specified for parameter `setvbuf'
/usr/include/stdio.h:337: error: syntax error before "__THROW"
/usr/include/stdio.h:347: error: storage class specified for parameter `setlinebuf'
/usr/include/stdio.h:347: error: syntax error before "__THROW"
/usr/include/stdio.h:362: error: storage class specified for parameter `printf'
/usr/include/stdio.h:365: error: storage class specified for parameter `sprintf'
/usr/include/stdio.h:365: error: syntax error before "__THROWNL"
/usr/include/stdio.h:372: error: syntax error before "__gnuc_va_list"
/usr/include/stdio.h:372: error: storage class specified for parameter `vfprintf'
/usr/include/stdio.h:377: error: syntax error before "__gnuc_va_list"
/usr/include/stdio.h:377: error: storage class specified for parameter `vprintf'
/usr/include/stdio.h:380: error: syntax error before "__gnuc_va_list"
/usr/include/stdio.h:380: error: storage class specified for parameter `vsprintf'
/usr/include/stdio.h:391: error: syntax error before "__gnuc_va_list"
/usr/include/stdio.h:392: error: storage class specified for parameter `vsnprintf'
/usr/include/stdio.h:416: error: storage class specified for parameter `dprintf'
/usr/include/stdio.h:420: error: syntax error before "__BEGIN_NAMESPACE_STD"
/usr/include/stdio.h:431: error: storage class specified for parameter `scanf'
/usr/include/stdio.h:431: error: syntax error before "__wur"
/usr/include/stdio.h:434: error: storage class specified for parameter `sscanf'
/usr/include/stdio.h:434: error: syntax error before "__THROW"
/usr/include/stdio.h:453: error: storage class specified for parameter `__isoc99_fscanf'
/usr/include/stdio.h:453: error: syntax error before "__wur"
/usr/include/stdio.h:454: error: storage class specified for parameter `__isoc99_scanf'
/usr/include/stdio.h:454: error: syntax error before "__wur"
/usr/include/stdio.h:456: error: storage class specified for parameter `__isoc99_sscanf'
/usr/include/stdio.h:456: error: syntax error before "__THROW"
/usr/include/stdio.h:479: error: syntax error before "__gnuc_va_list"
/usr/include/stdio.h:480: error: storage class specified for parameter `vscanf'
/usr/include/stdio.h:480: error: syntax error before "__wur"
/usr/include/stdio.h:484: error: syntax error before "__gnuc_va_list"
/usr/include/stdio.h:485: error: storage class specified for parameter `vsscanf'
/usr/include/stdio.h:510: error: syntax error before "__gnuc_va_list"
/usr/include/stdio.h:510: error: storage class specified for parameter `__isoc99_vfscanf'
/usr/include/stdio.h:512: error: syntax error before "__gnuc_va_list"
/usr/include/stdio.h:512: error: storage class specified for parameter `__isoc99_vscanf'
/usr/include/stdio.h:515: error: syntax error before "__gnuc_va_list"
/usr/include/stdio.h:515: error: storage class specified for parameter `__isoc99_vsscanf'
/usr/include/stdio.h:532: error: storage class specified for parameter `getc'
/usr/include/stdio.h:538: error: storage class specified for parameter `getchar'
/usr/include/stdio.h:539: error: syntax error before "__END_NAMESPACE_STD"
/usr/include/stdio.h:551: error: storage class specified for parameter `getchar_unlocked'
/usr/include/stdio.h:561: error: storage class specified for parameter `fgetc_unlocked'
/usr/include/stdio.h:565: error: syntax error before "__BEGIN_NAMESPACE_STD"
/usr/include/stdio.h:574: error: storage class specified for parameter `putc'
/usr/include/stdio.h:580: error: storage class specified for parameter `putchar'
/usr/include/stdio.h:581: error: syntax error before "__END_NAMESPACE_STD"
/usr/include/stdio.h:602: error: storage class specified for parameter `putc_unlocked'
/usr/include/stdio.h:603: error: storage class specified for parameter `putchar_unlocked'
/usr/include/stdio.h:610: error: storage class specified for parameter `getw'
/usr/include/stdio.h:613: error: storage class specified for parameter `putw'
/usr/include/stdio.h:617: error: syntax error before "__BEGIN_NAMESPACE_STD"
/usr/include/stdio.h:638: error: storage class specified for parameter `gets'
/usr/include/stdio.h:638: error: syntax error before "__wur"
/usr/include/stdio.h:668: error: storage class specified for parameter `__ssize_t'
/usr/include/stdio.h:668: error: redefinition of parameter '__ssize_t'
/usr/include/stdio.h:102: error: previous definition of '__ssize_t' was here
/usr/include/stdio.h:668: error: syntax error before "getdelim"
/usr/include/stdio.h:678: error: storage class specified for parameter `__ssize_t'
/usr/include/stdio.h:678: error: redefinition of parameter '__ssize_t'
/usr/include/stdio.h:668: error: previous definition of '__ssize_t' was here
/usr/include/stdio.h:678: error: syntax error before "getline"
/usr/include/stdio.h:695: error: storage class specified for parameter `puts'
/usr/include/stdio.h:702: error: storage class specified for parameter `ungetc'
/usr/include/stdio.h:710: error: storage class specified for parameter `fread'
/usr/include/stdio.h:710: error: syntax error before "__wur"
/usr/include/stdio.h:716: error: storage class specified for parameter `fwrite'
/usr/include/stdio.h:717: error: syntax error before "__END_NAMESPACE_STD"
/usr/include/stdio.h:740: error: storage class specified for parameter `fwrite_unlocked'
/usr/include/stdio.h:744: error: syntax error before "__BEGIN_NAMESPACE_STD"
/usr/include/stdio.h:754: error: storage class specified for parameter `ftell'
/usr/include/stdio.h:754: error: syntax error before "__wur"
/usr/include/stdio.h:759: error: storage class specified for parameter `rewind'
/usr/include/stdio.h:760: error: syntax error before "__END_NAMESPACE_STD"
/usr/include/stdio.h:778: error: storage class specified for parameter `__off_t'
/usr/include/stdio.h:778: error: redefinition of parameter '__off_t'
/usr/include/stdio.h:90: error: previous definition of '__off_t' was here
/usr/include/stdio.h:778: error: syntax error before "ftello"
/usr/include/stdio.h:803: error: syntax error before '*' token
/usr/include/stdio.h:803: error: storage class specified for parameter `fsetpos'
/usr/include/stdio.h:828: error: storage class specified for parameter `feof'
/usr/include/stdio.h:828: error: syntax error before "__THROW"
/usr/include/stdio.h:830: error: storage class specified for parameter `ferror'

If I try to compile with my gcc-4.8 compiler, it compiles it with no problem. I assume that I have problems with standard libraries. This VM is brand new, I didn't uninstall anything manually.

I need to use this compiler to test some buffer overflow exploits.

Thank you in advance.

This is the installing instruction I followed to download this older gcc version:

https://askubuntu.com/a/923342/890187

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.