CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Errors in stdio.h

  1. #1
    Join Date
    Dec 2017

    Errors in stdio.h

    I'm having the source code for an open source project without the project file, the project is written in C,
    I added the source code to an empty C project in Code Blocks and I'm getting some errors from stdio.h

    Error: c:\mingw\include\stdio.h|260|error: expected ',' or ';' before 'FILE'|
    On Line: _CRTIMP __cdecl __MINGW_NOTHROW FILE * fopen (const char *, const char *);

    All errors:
    ||=== Build: Debug in m2 (compiler: GNU GCC Compiler) ===|
    c:\mingw\include\stdio.h|260|error: expected ',' or ';' before 'FILE'|
    c:\mingw\include\stdio.h|1048|error: unknown type name '_END_C_DECLS'|
    c:\mingw\include\stdlib.h|99|error: expected '=', ',', ';', 'asm' or '__attribute__' before 'extern'|
    c:\mingw\include\stdlib.h|847|error: unknown type name '_END_C_DECLS'|
    c:\mingw\include\strings.h|63|error: expected '=', ',', ';', 'asm' or '__attribute__' before 'int'|
    c:\mingw\include\strings.h|100|error: unknown type name '_END_C_DECLS'|
    c:\mingw\include\string.h|70|error: expected ',' or ';' before 'void'|
    c:\mingw\include\assert.h|38|error: expected '=', ',', ';', 'asm' or '__attribute__' before 'void'|
    c:\mingw\include\inttypes.h|13|error: expected '=', ',', ';', 'asm' or '__attribute__' before 'typedef'|
    D:\m2\m2\compat\jansson\utf.h|20|error: expected '=', ',', ';', 'asm' or '__attribute__' before 'int'|
    D:\m2\m2\compat\jansson\dump.c||In function 'json_dump_file':|
    D:\m2\m2\compat\jansson\dump.c|452|warning: initialization makes pointer from integer without a cast [-Wint-conversion]|
    ||=== Build failed: 10 error(s), 1 warning(s) (0 minute(s), 1 second(s)) ===|

  2. #2
    2kaud's Avatar
    2kaud is online now Super Moderator Power Poster
    Join Date
    Dec 2012

    Re: Errors in stdio.h

    Can you post the code for dump.c (or up to the first function if its large) and for any include files that come before any of the standard c header files.
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++17 Compiler: Microsoft VS2019 (16.1.0)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)