Qt, windows and _POSIX_

I am working on building Qt 4.8.1 in VisualStudio 2005 and I am having an issue where the compiler could not find it _fileno

.

After some research I found that in stdio.h it has

#ifdef  _POSIX_
_CRTIMP __checkReturn int __cdecl fileno(__in FILE * _File);
#else
_CRTIMP __checkReturn int __cdecl _fileno(__in FILE * _File);
#endif

      

Then I looked at the qt code and found that qfsfilengine_win.cpp and qfilesystemengine_win.cpp have

#define _POSIX_

      

It seems to me that it would be a bug and if I remove these lines it seems to be successful.

Does anyone know why these files would define _POSIX_

?

Thank.

+3


source to share


1 answer


It seems that this is indeed a bug in Qt. If you are building Qt for windows without precompiled headers and you #define _POSIX_

run into this problem, simply remove the calls to qfsfilengine_win.cpp and qfilesystemengine_win.cpp and it will build successfully.



+1


source







All Articles