Ho installato gcc-3.4
a Debian 7.8
e creare un collegamento simbolico /usr/bin/gcc
.
Quando ho digitato gcc --version
Ottengo:
gcc (GCC) 3.4.6 (Debian 3.4.6.-9)
Quindi ho scritto un semplice programma in C.
#include <stdio.h>
int main(int argc, char **argv)
{
printf("hello");
return 0;
}
Ma ricevo tonnellate di messaggi di errore. Penso che il problema sia gcc-3.4
uso gcc-4.7
(predefinito gcc sul sistema) file di intestazione. ho scaricato gcc-3.4
a partire dal sito Web di gcc e scrivi:
gcc untitled.c -I/home/asd/Desktop/gcc-3.4
ma non funziona. Come posso usare i file di intestazione di gcc-3.4
durante la compilazione?
Gli errori iniziano come
In file included from /usr/include/stdio.h:28,
from untitled.c:1:
/usr/include/features.h:323:26: bits/predefs.h: No such file or directory
/usr/include/features.h:356:25: sys/cdefs.h: No such file or directory
/usr/include/features.h:388:23: gnu/stubs.h: No such file or directory
In file included from /usr/include/stdio.h:34,
from untitled.c:1:
/usr/lib/gcc/i486-linux-gnu/3.4.6/include/stddef.h:213: error: syntax error before "typedef"
In file included from untitled.c:1:
/usr/include/stdio.h:36:25: bits/types.h: No such file or directory
In file included from untitled.c:1:
/usr/include/stdio.h:49: error: syntax error before "typedef"
/usr/include/stdio.h:54: error: syntax error before "__USING_NAMESPACE_STD"
/usr/include/stdio.h: In function `__USING_NAMESPACE_STD':
/usr/include/stdio.h:65: error: storage class specified for parameter `__FILE'
In file included from /usr/include/_G_config.h:20,
from /usr/include/libio.h:32,
from /usr/include/stdio.h:75,
from untitled.c:1:
/usr/include/wchar.h:95: error: storage class specified for parameter `__mbstate_t'
In file included from /usr/include/libio.h:32,
from /usr/include/stdio.h:75,
from untitled.c:1:
/usr/include/_G_config.h:24: error: syntax error before "__off_t"
/usr/include/_G_config.h:29: error: syntax error before "__off64_t"
/usr/include/_G_config.h:53: error: storage class specified for parameter `_G_int16_t'
/usr/include/_G_config.h:54: error: storage class specified for parameter `_G_int32_t'
/usr/include/_G_config.h:55: error: storage class specified for parameter `_G_uint16_t'
/usr/include/_G_config.h:56: error: storage class specified for parameter `_G_uint32_t'
In file included from /usr/include/libio.h:53,
from /usr/include/stdio.h:75,
from untitled.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:75,
from untitled.c:1:
/usr/include/libio.h:180: error: storage class specified for parameter `_IO_lock_t'
/usr/include/libio.h:300: error: syntax error before "__off_t"
/usr/include/libio.h:310: error: syntax error before "_IO_lock_t"
/usr/include/libio.h:338: error: syntax error before '}' token
/usr/include/libio.h:341: error: storage class specified for parameter `_IO_FILE'
/usr/include/libio.h:346: error: storage class specified for parameter `_IO_2_1_stdin_'
/usr/include/libio.h:347: error: storage class specified for parameter `_IO_2_1_stdout_'
/usr/include/libio.h:348: error: storage class specified for parameter `_IO_2_1_stderr_'
/usr/include/libio.h:364: error: storage class specified for parameter `__ssize_t'
/usr/include/libio.h:364: error: syntax error before "__io_read_fn"
/usr/include/libio.h:372: error: storage class specified for parameter `__ssize_t'
/usr/include/libio.h:372: error: redefinition of parameter '__ssize_t'
/usr/include/libio.h:364: error: previous definition of '__ssize_t' was here
L'output completo di gcc in esecuzione è disponibile all'indirizzo http://pastebin.com/jFRihqUw
glibc
pacchetto nel mio sistema. Ci sono glibc-doc
, glibc-doc-reference
e glibc-source
pacchi. Cosa dovrei fare?