MinGW编译错误-'__off64_t'未命名类型

时间:2018-12-26 18:42:11

标签: c++ mingw

我刚刚在Windows PC上重新安装了MinGW和Codelite IDE,但是现在无法编译/构建项目。

这很奇怪,因为每次更改设置或创建新项目时,我都可以运行一次,然后它停止工作。

我已经尝试过重新安装MinGW ...

enter image description here

1 个答案:

答案 0 :(得分:1)

这可能是应用c ++ 11或更高标准时发生的gcc错误,即添加参数“ -std = c ++ 11”或“ -std = c ++ 0x”。 我通过在文件stdio.h中添加“ #include“ io.h””来修复它。

您可以转到包含路径:“ c:/ mingw / include”并编辑“ stdio.h”。

/* * stdio.h * * Definitions of types and prototypes of functions for operations on * standard input and standard output streams. * * $Id: stdio.h,v 8863016e809f 2018/12/04 19:00:29 keith $ * * Written by Colin Peters * Copyright (C) 1997-2005, 2007-2010, 2014-2018, MinGW.org Project. * * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice, this permission notice, and the following * disclaimer shall be included in all copies or substantial portions of * the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OF OR OTHER * DEALINGS IN THE SOFTWARE. * * NOTE: The file manipulation functions provided by Microsoft seem to * work with either slash (/) or backslash () as the directory separator; * (this is consistent with Microsoft's own documentation, on MSDN). * */ #include //include at here #ifndef _STDIO_H #pragma GCC system_header

/* When including <wchar.h>, some of the definitions and declarations
 * which are nominally provided in <stdio.h> must be duplicated.  Rather
 * than require duplicated maintenance effort, we provide for partial
 * inclusion of <stdio.h> by <wchar.h>; only when not included in
 * this partial fashion...
 */

/* When including <wchar.h>, some of the definitions and declarations * which are nominally provided in <stdio.h> must be duplicated. Rather * than require duplicated maintenance effort, we provide for partial * inclusion of <stdio.h> by <wchar.h>; only when not included in * this partial fashion... */

如果有任何问题或更好的解决方案,我将非常高兴收到您的反馈。