[Interest] Compilation error
Kai.Koehne at digia.com
Wed Aug 28 20:01:00 CEST 2013
>On quarta-feira, 28 de agosto de 2013 15:27:07, Koehne Kai wrote:
>> > main.cpp:196:36: error: '_fileno' was not declared in this scope
>> > I would be grateful if anyone can advise why I am getting this error and
>> > how I might fix it
>> First of all, you're apparently not alone
>> http://qt-project.org/forums/viewthread/26287 .
>> Anyway, which mingw gcc / package are you using?
> fileno(3) is POSIX.1. It's not part of the C nor C++ standard libraries.
> On Windows, MS decided to add some POSIX functions with an underscore (_fileno,
> _open, etc.). Therefore, the correct on Windows is _fileno.
> Conclusion: your C headers are broken.
To extend this a bit: For Qt 5.x we're recommending a toolchain that uses a pretty recent version of the headers / runtime from the MinGW-w64 project. The official binaries for 5.1 are generated with http://sourceforge.net/projects/mingwbuilds/files/host-windows/releases/4.8.0/32-bit/threads-posix/dwarf/x32-4.8.0-release-posix-dwarf-rev2.7z , but other toolchains like from TDM-gcc that also rely on MinGW-w64 should do to (though we don't test this actively).
Could be that you're using a toolchain from mingw.org . That's not supported.
Thiago Macieira - thiago.macieira (AT) intel.com
Software Architect - Intel Open Source Technology Center
More information about the Interest