开发者

Why is errno not found in Visual Studio 6.0?

开发者 https://www.devze.com 2023-01-07 06:55 出处:网络
#include <errno.h> /* compress until end of file */ 开发者_StackOverflow社区 do { strm.avail_in = fread(in, 1, CHUNK, source);
#include <errno.h>  
  /* compress until end of file */
 开发者_StackOverflow社区 do {
       strm.avail_in = fread(in, 1, CHUNK, source);
       errno; //<-----DEBUGGER "CXX0017: Error: symbol errno not found"  
       perror("Error:");

      if (ferror(source)) //<--ferror = 32 but there is no string from perror? 
      {
         //error handling


When you build with the DLL version of the CRT (/MDd for example), errno is a macro. Translating it to a function call to obtain the shared value of errno. Fix it like this:

int err = errno;

so you can inspect the value of err.

0

精彩评论

暂无评论...
验证码 换一张
取 消