Build error when building Qt 4.8.1 for VS2005



  • Hi all,
    I am getting the following errors when building Qt 4.8.1 for VS2005.

    My guess is that that there is some issue including stdio.h. Any help would be appreciated.

    Thanks.

    Error 19 error C3861: '_fileno': identifier not found c:\Dev\Builds\Qt\qt-everywhere-opensource-src-4.8.1\src\corelib\io\qfsfileengine_win.cpp 443
    Error 20 error C3861: '_fileno': identifier not found c:\Dev\Builds\Qt\qt-everywhere-opensource-src-4.8.1\src\corelib\io\qfsfileengine_win.cpp 468
    Error 21 error C3861: '_fileno': identifier not found c:\Dev\Builds\Qt\qt-everywhere-opensource-src-4.8.1\src\corelib\io\qfsfileengine_win.cpp 607
    Error 22 error C3861: '_fileno': identifier not found c:\Dev\Builds\Qt\qt-everywhere-opensource-src-4.8.1\src\corelib\io\qfsfileengine_win.cpp 852
    Error 23 error C3861: '_fileno': identifier not found c:\Dev\Builds\Qt\qt-everywhere-opensource-src-4.8.1\src\corelib\io\qfsfileengine_win.cpp 914



  • My guest is that you are looking for, in the wrong place. Go in "projects" and make sure that is not your problem!



  • I don't understand what you mean. I am trying to build the projects solution and it is failing to build QtCore with the errors above.



  • Hmm, tried to post this once already and it got lost.

    I noticed 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@

    Noticing this, I changed qplatformdefs.h to define QT_FILENO as fileno instead of _fileno:
    @#define QT_FILENO fileno@

    This seemed to enable me to compile, but makes me nervous.

    Is there somewhere in the configure process that I am supposed to do something which doesn't define _POSIX _ (ignore the extra space)?

    Thanks.



  • It seems that the issue is that qfilesystemengine_win.cpp and qfsfileengine_win.cpp are both calling @#define POSIX@

    Why are they doing this? It seems wrong to me.

    Thanks.



  • The first line of qfsfileengine_win.cpp is

    @
    #define POSIX
    @

    I don't know why it is there, and why it works in most cases.

    --
    Debao



  • It seems that it works in most cases because qt is by default compiled using precompiled headers, and qt_pch.h calls @#undef POSIX@ which avoids the problem. We were compiling without the precompiled_headers flag, which was exposing the problem.

    I think that the @#define POSIX@ is incorrect and needs to be removed from those 2 files.



  • Seems OK, I will try to commit a patch for Qt5. When it get merged, we can commit another patch for Qt4.8.

    ;-)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.