我有一个在Unix上成功编译和运行的C程序。现在我需要在Suse(一种Linux)中编译它。不幸的是,编译时有很多错误如下:
In file included from /usr/include/stdio.h:37,
from /si/usr/hrl/gdetsdev/include/arch/err.h:24,
from err.c:52:
/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 /si/usr/hrl/gdetsdev/include/arch/err.h:24,
from err.c:52:
/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 /si/usr/hrl/gdetsdev/include/arch/err.h:24,
from err.c:52:
/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:372: error:expected declaration specifiers or ‘...’ before ‘size_t’
/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’
In file included from /si/usr/hrl/gdetsdev/include/arch/err.h:25,
from err.c:52:
/usr/include/stdlib.h:140: error:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__ctype_get_mb_cur_max’
In file included from /si/usr/hrl/gdetsdev/include/arch/err.h:25,
from err.c:52:
/usr/include/stdlib.h:337: error:expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/stdlib.h:367: error:expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/stdlib.h:471: error:expected ‘)’ before ‘__size’
/usr/include/stdlib.h:473: error:expected ‘)’ before ‘__nmemb’
/usr/include/stdlib.h:485: error:expected declaration specifiers or ‘...’ before ‘size_t’
In file included from /usr/include/stdlib.h:497,
from /si/usr/hrl/gdetsdev/include/arch/err.h:25,
from err.c:52:
/usr/include/alloca.h:33: error:expected ‘)’ before ‘__size’
In file included from /si/usr/hrl/gdetsdev/include/arch/err.h:25,
from err.c:52:
/usr/include/stdlib.h:502: error:expected ‘)’ before ‘__size’
/usr/include/stdlib.h:507: error:expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/stdlib.h:507: error:expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/stdlib.h:751: error:expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/stdlib.h:751: error:expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/stdlib.h:756: error:expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/stdlib.h:756: error:expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/stdlib.h:834: error:expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/stdlib.h:837: error:expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/stdlib.h:841: error:expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/stdlib.h:845: error:expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/stdlib.h:854: error:expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/stdlib.h:858: error:expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/stdlib.h:865: error:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘mbstowcs’
/usr/include/stdlib.h:868: error:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘wcstombs’
In file included from /si/usr/hrl/gdetsdev/include/arch/err.h:26,
from err.c:52:
/usr/include/string.h:44: error:expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/string.h:48: error:expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/string.h:57: error:expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/string.h:64: error:expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/string.h:67: error:expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/string.h:94: error:expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/string.h:131: error:expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/string.h:139: error:expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/string.h:145: error:expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/string.h:152: error:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘strxfrm’
In file included from /si/usr/hrl/gdetsdev/include/arch/err.h:26,
from err.c:52:
/usr/include/string.h:167: error:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘strxfrm_l’
/usr/include/string.h:181: error:expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/string.h:282: error:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘strcspn’
/usr/include/string.h:286: error:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘strspn’
/usr/include/string.h:397: error:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘strlen’
/usr/include/string.h:404: error:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘strnlen’
/usr/include/string.h:425: error:expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/string.h:449: error:expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/string.h:453: error:expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/string.h:457: error:expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/string.h:460: error:expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/string.h:538: error:expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/string.h:575: error:expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/string.h:578: error:expected declaration specifiers or ‘...’ before ‘size_t’
In file included from /si/usr/hrl/gdetsdev/include/arch/err.h:27,
from err.c:52:
/usr/include/unistd.h:357: error:expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/unistd.h:363: error:expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/unistd.h:507: error:expected declaration specifiers or ‘...’ before ‘size_t’
In file included from /si/usr/hrl/gdetsdev/include/arch/err.h:27,
from err.c:52:
/usr/include/unistd.h:618: error:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘confstr’
/usr/include/unistd.h:790: error:expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/unistd.h:826: error:expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/unistd.h:837: error:expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/unistd.h:873: error:expected declaration specifiers or ‘...’ before ‘size_t’
In file included from /si/usr/hrl/gdetsdev/include/arch/err.h:27,
from err.c:52:
/usr/include/unistd.h:895: error:expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/unistd.h:902: error:expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/unistd.h:913: error:expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/unistd.h:915: error:expected declaration specifiers or ‘...’ before ‘size_t’
/usr/include/unistd.h:933: error:expected declaration specifiers or ‘...’ before ‘size_t‘
......
还有很多功能参数(比如'memset','strncpy'等等)。 我不知道是不是由于UNIX和Linux之间的差异造成的。有人告诉我在尝试在Linux上编译C程序时应该注意什么? 感谢。