Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Build error when building Qt 4.8.1 for VS2005
Forum Updated to NodeBB v4.3 + New Features

Build error when building Qt 4.8.1 for VS2005

Scheduled Pinned Locked Moved General and Desktop
8 Posts 3 Posters 4.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    LKIM
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • F Offline
      F Offline
      felipe.c.sousa
      wrote on last edited by
      #2

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

      From all, to all.

      1 Reply Last reply
      0
      • L Offline
        L Offline
        LKIM
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0
        • L Offline
          L Offline
          LKIM
          wrote on last edited by
          #4

          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.

          1 Reply Last reply
          0
          • L Offline
            L Offline
            LKIM
            wrote on last edited by
            #5

            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.

            1 Reply Last reply
            0
            • D Offline
              D Offline
              dbzhang800
              wrote on last edited by
              #6

              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

              1 Reply Last reply
              0
              • L Offline
                L Offline
                LKIM
                wrote on last edited by
                #7

                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.

                1 Reply Last reply
                0
                • D Offline
                  D Offline
                  dbzhang800
                  wrote on last edited by
                  #8

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

                  ;-)

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved