Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Qt5 MinGW build error: '_fileno' was not declared
Forum Updated to NodeBB v4.3 + New Features

Qt5 MinGW build error: '_fileno' was not declared

Scheduled Pinned Locked Moved Installation and Deployment
10 Posts 8 Posters 9.3k 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.
  • J Offline
    J Offline
    Jake007
    wrote on last edited by
    #1

    Hi!

    I'm trying to build Qt5 shared, as I can't stand those enormous icuu libraries.
    But I'm having problem building it.

    This is an error that I get:
    @main.cpp: In member function 'virtual QVariant PatternistApplicationParser::defaultValue(const QApplicationArgument&) const':
    main.cpp:196:36: error: '_fileno' was not declared in this scope
    mingw32-make[4]: *** [.obj/release_shared/main.o] Error 1
    mingw32-make[4]: Leaving directory 'C:/Dev/Qt5/Qt5_MinGW_Shared/qtxmlpatterns/tools/xmlpatterns'@

    Happens with static and shared build on Windows 7 and Windows 8, both 64-bit.
    I'm using MinGW 4.7.2 32-bit.
    I followed the tutorial "here":http://qt-project.org/wiki/Building_Qt_5_from_Git: building Qt5 from git, and added -no-webkit flag and -opengl desktop.

    Search didn't throw me any useful results.

    Regards,
    Jake


    Code is poetry

    1 Reply Last reply
    0
    • C Offline
      C Offline
      chipsman
      wrote on last edited by
      #2

      Hi!

      Are they someone to help? I have exactly the same problem.

      I noticed that the compiler uses the strict ansi norm, so the _fileno function is not defined. Commenting
      @#ifndef STRICT_ANSI@

      and the matching #endif in the stdio.h file is working but very tricky.

      Before updating the sources, I never had any problem to compile Qt.

      Best regards

      1 Reply Last reply
      0
      • K Offline
        K Offline
        kalpa
        wrote on last edited by
        #3

        Hi all!
        Had the same problem.
        Does everybody must have to patch stdio.h?

        Oleg Shalnev

        1 Reply Last reply
        0
        • J Offline
          J Offline
          Jake007
          wrote on last edited by
          #4

          Hi!

          I didn't patch it.
          I downloaded source code from "here":http://qt-project.org/downloads and build this one instead. It builds without any problems.


          Code is poetry

          1 Reply Last reply
          0
          • K Offline
            K Offline
            kalpa
            wrote on last edited by
            #5

            Current git version abort compilation with this error message.

            Oleg Shalnev

            1 Reply Last reply
            0
            • C Offline
              C Offline
              Code_ReaQtor
              wrote on last edited by
              #6

              I have the same problem with the current Qt 5.1 Beta in Windows 7 32-bit using MinGW 4.7

              Anybody who solved this problem?

              Additional Info: Error is found within <Qt5_directory>/qtxmlpatterns/tools/xmlpatterns/main.cpp

              @//from main.cpp
              #ifdef Q_OS_WIN
              /* If we don't open stdout in "binary" mode on Windows, it will translate
              * 0xA into 0xD 0xA. */
              _setmode(_fileno(stdout), _O_BINARY);
              m_stdout = _wfdopen(_fileno(stdout), L"wb");
              out->open(m_stdout, QIODevice::WriteOnly);
              #else
              out->open(stdout, QIODevice::WriteOnly);
              #endif
              @

              Please visit my open-source projects at https://github.com/Code-ReaQtor.

              1 Reply Last reply
              0
              • A Offline
                A Offline
                AcerExtensa
                wrote on last edited by
                #7

                Same here. I also get alot warnings about not found generated files within webkit module compilation...

                God is Real unless explicitly declared as Integer.

                1 Reply Last reply
                0
                • K Offline
                  K Offline
                  kay_jpr
                  wrote on last edited by
                  #8

                  Iam facing the same error. Building Qt 5.1.1, on windows 8 (32 bit), using mingw32-make .

                  URGENT help needed !!

                  1 Reply Last reply
                  0
                  • J Offline
                    J Offline
                    josuegomes
                    wrote on last edited by
                    #9

                    This is not a fix but a workaround. I'm not sure if this is a MinGW or Qt issue.
                    Anyway here we go: modify qt-everywhere-opensource-src-5.1.1/qtxmlpatterns/tools/xmlpatterns/main.cpp
                    and add before #include "main.h"

                    #include <stdio.h>
                    extern "C" {
                    _CRTIMP int __cdecl __MINGW_NOTHROW _fileno (FILE*);
                    }

                    1 Reply Last reply
                    0
                    • S Offline
                      S Offline
                      sugi2undip
                      wrote on last edited by
                      #10

                      adding following one line in xmlpatterns\main.cpp before #include "main.h" apparently solve the problem..

                      #define _fileno(F) ((F)->_file)

                      hope everybody got same result...

                      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