2010-07-16 37 views
0
#include <errno.h> 
    /* compress until end of file */ 
    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 

回答

1

當您使用CRT的DLL版本(例如/ MDd)構建時,errno是一個宏。將其轉換爲函數調用以獲取errno的共享值。解決這個問題是這樣的:

int err = errno; 

,所以你可以檢查ERR的值。

+0

太棒了!謝謝! (err = 9) – 2010-07-16 20:32:59

相關問題