|
首先我通过uname -a查看系统信息: Linux tegra-ubuntu 3.10.67-g3a5c467 #1 SMP PREEMPT Fri Oct 30 14:26:17 PDT 2015 aarch64 aarch64 aarch64 GNU/Linux 编写一个简单的程序hello.c: #include "stdio.h" int main(void) { printf("Hello world!"); return 0; } 执行命令‘gcc hello.c’, 显示如下错误: gaojianhua@tegra-ubuntu:~/cuda_learn$ gcc hello.c In file included from /usr/local/include/forwards.h:10:0, from /usr/local/include/features.h:10, from /usr/include/stdio.h:27, from hello.c:1: /usr/local/include/config.h:116:1: error: unknown type name ‘namespace’ namespace Json { ^ /usr/local/include/config.h:116:16: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token namespace Json { ^ In file included from /usr/local/include/features.h:10:0, from /usr/include/stdio.h:27, from hello.c:1: /usr/local/include/forwards.h:13:1: error: unknown type name ‘namespace’ namespace Json { ^ /usr/local/include/forwards.h:13:16: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token namespace Json { ^ In file included from /usr/include/stdio.h:27:0, from hello.c:1: /usr/local/include/features.h:13:1: error: unknown type name ‘namespace’ namespace Json { ^ /usr/local/include/features.h:13:16: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token namespace Json { ^ In file included from /usr/include/stdio.h:33:0, from hello.c:1: /usr/lib/gcc/arm-linux-gnueabihf/4.8/include/stddef.h:212:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘typedef’ typedef __SIZE_TYPE__ size_t; ^ In file included from hello.c:1:0: /usr/include/stdio.h:48:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘typedef’ typedef struct _IO_FILE FILE; ^ /usr/include/stdio.h:64:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘typedef’ typedef struct _IO_FILE __FILE; ^ In file included from /usr/include/libio.h:56:0, from /usr/include/stdio.h:74, from hello.c:1: /usr/include/arm-linux-gnueabihf/sys/cdefs.h:41:20: error: missing binary operator before token "(" # if __GNUC_PREREQ (4, 6) && !defined _LIBC ^ /usr/include/arm-linux-gnueabihf/sys/cdefs.h:54:44: error: missing binary operator before token "(" # if !defined __cplusplus && __GNUC_PREREQ (3, 3) ^ /usr/include/arm-linux-gnueabihf/sys/cdefs.h:59:44: error: missing binary operator before token "(" # if defined __cplusplus && __GNUC_PREREQ (2,8) ^ /usr/include/arm-linux-gnueabihf/sys/cdefs.h:136:19: error: missing binary operator before token "(" #if __GNUC_PREREQ (4,3) ^ /usr/include/arm-linux-gnueabihf/sys/cdefs.h:149:19: error: missing binary operator before token "(" #if __GNUC_PREREQ (2,97) ^ /usr/include/arm-linux-gnueabihf/sys/cdefs.h:211:19: error: missing binary operator before token "(" #if __GNUC_PREREQ (2,96) ^ /usr/include/arm-linux-gnueabihf/sys/cdefs.h:219:19: error: missing binary operator before token "(" #if __GNUC_PREREQ (4, 3) ^ /usr/include/arm-linux-gnueabihf/sys/cdefs.h:229:19: error: missing binary operator before token "(" #if __GNUC_PREREQ (2,96) ^ /usr/include/arm-linux-gnueabihf/sys/cdefs.h:236:19: error: missing binary operator before token "(" #if __GNUC_PREREQ (2,5) ^ /usr/include/arm-linux-gnueabihf/sys/cdefs.h:245:19: error: missing binary operator before token "(" #if __GNUC_PREREQ (3,1) ^ /usr/include/arm-linux-gnueabihf/sys/cdefs.h:254:19: error: missing binary operator before token "(" #if __GNUC_PREREQ (3,2) ^ /usr/include/arm-linux-gnueabihf/sys/cdefs.h:266:19: error: missing binary operator before token "(" #if __GNUC_PREREQ (2,8) ^ /usr/include/arm-linux-gnueabihf/sys/cdefs.h:276:19: error: missing binary operator before token "(" #if __GNUC_PREREQ (2,97) ^ /usr/include/arm-linux-gnueabihf/sys/cdefs.h:285:19: error: missing binary operator before token "(" #if __GNUC_PREREQ (3,3) ^ /usr/include/arm-linux-gnueabihf/sys/cdefs.h:293:19: error: missing binary operator before token "(" #if __GNUC_PREREQ (3,4) ^ /usr/include/arm-linux-gnueabihf/sys/cdefs.h:307:19: error: missing binary operator before token "(" #if __GNUC_PREREQ (3,2) ^ /usr/include/arm-linux-gnueabihf/sys/cdefs.h:315:19: error: missing binary operator before token "(" #if __GNUC_PREREQ (4,3) ^ /usr/include/arm-linux-gnueabihf/sys/cdefs.h:341:19: error: missing binary operator before token "(" #if __GNUC_PREREQ (4,3) ^ /usr/include/arm-linux-gnueabihf/sys/cdefs.h:350:20: error: missing binary operator before token "(" #if !__GNUC_PREREQ (2,8) ^ /usr/include/arm-linux-gnueabihf/sys/cdefs.h:355:20: error: missing binary operator before token "(" #if !__GNUC_PREREQ (2,92) ^ /usr/include/arm-linux-gnueabihf/sys/cdefs.h:362:19: error: missing binary operator before token "(" #if __GNUC_PREREQ (3,1) && !defined __GNUG__ ^ In file included from /usr/include/stdio.h:74:0, from hello.c:1: /usr/include/libio.h:306:3: error: unknown type name ‘size_t’ size_t __pad5; ^ /usr/include/libio.h:310:67: error: ‘size_t’ undeclared here (not in a function) char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)]; ^ /usr/include/libio.h:338:62: error: expected declaration specifiers or ‘...’ before ‘size_t’ typedef __ssize_t __io_read_fn (void *__cookie, char *__buf, size_t __nbytes); ^ /usr/include/libio.h:347:6: error: expected declaration specifiers or ‘...’ before ‘size_t’ size_t __n); ^ /usr/include/libio.h:469:19: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_IO_sgetn’ extern _IO_size_t _IO_sgetn (_IO_FILE *, void *, _IO_size_t); ^ In file included from hello.c:1:0: /usr/include/stdio.h:195:1: error: unknown type name ‘FILE’ extern FILE *tmpfile (void) __wur; ^ /usr/include/stdio.h:237:20: error: unknown type name ‘FILE’ extern int fclose (FILE *__stream); ^ /usr/include/stdio.h:242:20: error: unknown type name ‘FILE’ extern int fflush (FILE *__stream); ^ /usr/include/stdio.h:272:1: error: unknown type name ‘FILE’ extern FILE *fopen (const char *__restrict __filename, ^ /usr/include/stdio.h:278:1: error: unknown type name ‘FILE’ extern FILE *freopen (const char *__restrict __filename, ^ /usr/include/stdio.h:280:9: error: unknown type name ‘FILE’ FILE *__restrict __stream) __wur; ^ /usr/include/stdio.h:332:21: error: unknown type name ‘FILE’ extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __THROW; ^ /usr/include/stdio.h:336:21: error: unknown type name ‘FILE’ extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf, ^ /usr/include/stdio.h:337:20: error: expected declaration specifiers or ‘...’ before ‘size_t’ int __modes, size_t __n) __THROW; ^ /usr/include/stdio.h:356:21: error: unknown type name ‘FILE’ extern int fprintf (FILE *__restrict __stream, ^ /usr/include/stdio.h:371:22: error: unknown type name ‘FILE’ extern int vfprintf (FILE *__restrict __s, const char *__restrict __format, ^ /usr/include/stdio.h:425:20: error: unknown type name ‘FILE’ extern int fscanf (FILE *__restrict __stream, ^ /usr/include/stdio.h:531:19: error: unknown type name ‘FILE’ extern int fgetc (FILE *__stream); ^ /usr/include/stdio.h:532:18: error: unknown type name ‘FILE’ extern int getc (FILE *__stream); ^ /usr/include/stdio.h:573:28: error: unknown type name ‘FILE’ extern int fputc (int __c, FILE *__stream); ^ /usr/include/stdio.h:574:27: error: unknown type name ‘FILE’ extern int putc (int __c, FILE *__stream); ^ /usr/include/stdio.h:622:52: error: unknown type name ‘FILE’ extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream) ^ /usr/include/stdio.h:689:47: error: unknown type name ‘FILE’ extern int fputs (const char *__restrict __s, FILE *__restrict __stream); ^ /usr/include/stdio.h:702:29: error: unknown type name ‘FILE’ extern int ungetc (int __c, FILE *__stream); ^ /usr/include/stdio.h:709:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘fread’ extern size_t fread (void *__restrict __ptr, size_t __size, ^ /usr/include/stdio.h:715:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘fwrite’ extern size_t fwrite (const void *__restrict __ptr, size_t __size, ^ /usr/include/stdio.h:749:19: error: unknown type name ‘FILE’ extern int fseek (FILE *__stream, long int __off, int __whence); ^ /usr/include/stdio.h:754:24: error: unknown type name ‘FILE’ extern long int ftell (FILE *__stream) __wur; ^ /usr/include/stdio.h:759:21: error: unknown type name ‘FILE’ extern void rewind (FILE *__stream); ^ /usr/include/stdio.h:798:21: error: unknown type name ‘FILE’ extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos); ^ /usr/include/stdio.h:803:21: error: unknown type name ‘FILE’ extern int fsetpos (FILE *__stream, const fpos_t *__pos); ^ /usr/include/stdio.h:826:23: error: unknown type name ‘FILE’ extern void clearerr (FILE *__stream) __THROW; ^ /usr/include/stdio.h:828:18: error: unknown type name ‘FILE’ extern int feof (FILE *__stream) __THROW __wur; ^ /usr/include/stdio.h:830:20: error: unknown type name ‘FILE’ extern int ferror (FILE *__stream) __THROW __wur;
有没有大神能够帮忙解决一下。
|