Windows下开发的源程序要移植到Linux平台上来,前提是C程序要规范。
如果所用到的头文件都是C语言标准库中的头文件。
C89标准中:
<assert.h>
<ctype.h>
<errno.h>
<float.h>
<limits.h>
<locale.h>
<math.h>
<setjmp.h>
<signal.h>
<stdarg.h>
<stddef.h>
<stdio.h>
<stdlib.h>
<string.h>
<time.h>
在95年的修正版中
<iso646.h>
<wchar.h>
<wctype.h>
在C99中增加了六个函数库
<complex.h>
<fenv.h>
<inttypes.h>
<stdbool.h>
<stdint.h>
<tgmath.h>
如果C程序只用到这些头文件,那么将源程序直接拷到Linux下就可以了。
在Windows下使用Windows版的C语言编译器,即a Linux-like enviroment for Windows。
在google搜索:windows download site:gcc.gnu.org