这是代码。。。。。真是汗啊。。。搞得我整夜没睡。。。作者: nully 时间: 2006-10-19 13:53
移植一些小东西而已,通常不会有太多unix的东西,用mingw足矣。作者: delimy 时间: 2006-10-19 14:28
楼主的理所当然真是奇怪。
man errno:
errno is defined by the ISO C standard to be a modifiable lvalue of
type int, and must *not* be explicitly declared; errno may be a macro.
errno is thread-local; setting it in one thread does not affect its
value in any other thread.作者: lenovo 时间: 2006-10-19 15:25
这个问题和mingw没关系,
具体解释看楼上。作者: langue 时间: 2006-10-19 18:46
问题就是,有的系统上是宏定义,有的直接用符号了。作者: whyglinux 时间: 2006-10-19 19:22
在程序中包含标准库的头文件(如<stdio.h>)会导致引入 errno 标识符,它是一个保留的标识符。根据标准的规定,在使用了 C 标准库的程序中声明或者定义这个标识符是未定义行为。因此问题出在上面写的程序中,而不是 MinGW 的问题—— MinGW 中如此定义 errno 是符合标准的。作者: F.D.Roosevelt 时间: 2006-10-19 19:35
同意 7 楼和 10 楼