Menu

Unable to compile: errors in stdio.h ?

biterman
2004-04-23
2012-09-26
  • biterman

    biterman - 2004-04-23

    I'm having serious problems with Dev-C++ 5 (4.9.8.0 & 4.9.8.7) on a Win98SE machine.

    I can't compile any single source file console program... anything that has sdtio.h
    gives me a Compile Log similar to this:

    /* Compile Log: Failure */

    Compiler: Default compiler
    Executing  gcc.exe...
    gcc.exe "C:\Dario\Programming\test.c" -o "C:\Dario\Programming\test.exe"    -I"C:\DEV-CPP\include"   -L"C:\DEV-CPP\lib"
    In file included from C:\Dario\Programming\test.c:1:
    C:\DEV-CPP\include\stdio.h:216: type specifier omitted for parameter
    C:\DEV-CPP\include\stdio.h:217: type specifier omitted for parameter
    C:\DEV-CPP\include\stdio.h:218: type specifier omitted for parameter
    C:\DEV-CPP\include\stdio.h:219: type specifier omitted for parameter
    C:\DEV-CPP\include\stdio.h:224: type specifier omitted for parameter
    C:\DEV-CPP\include\stdio.h:224: parse error before `)'
    C:\DEV-CPP\include\stdio.h: In function `int vsnprintf(...)':
    C:\DEV-CPP\include\stdio.h:225: `s' undeclared (first use this function)
    C:\DEV-CPP\include\stdio.h:225: (Each undeclared identifier is reported only once
    C:\DEV-CPP\include\stdio.h:225: for each function it appears in.)
    C:\DEV-CPP\include\stdio.h:225: `n' undeclared (first use this function)
    C:\DEV-CPP\include\stdio.h:225: `format' undeclared (first use this function)
    C:\DEV-CPP\include\stdio.h:225: `arg' undeclared (first use this function)
    C:\DEV-CPP\include\stdio.h: At top level:
    C:\DEV-CPP\include\stdio.h:349: type specifier omitted for parameter
    C:\DEV-CPP\include\stdio.h:350: type specifier omitted for parameter
    C:\DEV-CPP\include\stdio.h:351: type specifier omitted for parameter
    C:\DEV-CPP\include\stdio.h:352: type specifier omitted for parameter
    C:\DEV-CPP\include\stdio.h:383: type specifier omitted for parameter
    C:\DEV-CPP\include\stdio.h:383: parse error before `)'

    Execution terminated

    /* End Compile Log Failure */

    Funny thing though, if I try to compile the same thing but as a Project it works fine.
    Compile Log:

    /* Compile Log Success */

    Compiler: Default compiler
    Building Makefile: "C:\Dario\Programming\test\Makefile.win"
    Executing  make...
    make.exe -f "C:\Dario\Programming\test\Makefile.win" all
    gcc.exe main.o  -o "test.exe" -L"C:/DEV-CPP/lib" Execution terminated
    Compilation successful

    /* End Compile Log Success */

    At first I had my Dev installation in a path with spaces and my source files where in a
    path with spaces too. So I fixed that in hopes it would help... here's a summary of what
    I've done

    I followed the uninstallation procedure that's in the forums at sourceforge.

    1. I ran the uninstall from the dev directory.
    2. I deleted the dev dir along with the config files.
    3. I did a search for any other files that might be around somewhere, there weren't any.
    4. I rebooted.
    5. I redownloaded the installation file.
    6. I installed to C:\Dev-Cpp
    7. I ran the autoupdate feature. (I just clicked on Tools/Check for Updates/Packages
        vUpdate ran first, then the WebUpdate thingie.)
    8. I changed the dirs my sources are in to names with no spaces.
    9. I tried again.
    10. Failed miserably.

    That didn't help at all, so I:

    1. repeated the uninstallation process
    2. Downloaded the devcpp4987.zip file
    3. reinstalled (this time I didn't redownload the installation file)
    4. Tried to compile from the clean install without updating anything: No success.
    5. Updated from the zip file.
    6. Tried to compile, no success either.

    So that's  pretty much all I did.

    Thanks in advance..

    adios,
    dario.

    PS: Windows programs compile fine, projects and single source files. It seems the prob
    is with stdio.h

    The test.c code can be found here (this link will expire in 24 hours)
    http://rafb.net/paste/results/MD178097.html

     
    • biterman

      biterman - 2004-04-23

      Oh, I forgot to mention.

      If I pass this:
      "C:\Dario\Programming\test.c" -o "C:\Dario\Programming\test.exe" -I"C:\DEV-CPP\include" -L"C:\DEV-CPP\lib"

      straight to gcc, outside of Dev, It compiles fine.

      adios,
      biterman

       
      • Anonymous

        Anonymous - 2004-04-23

        What if you run

        make -fmakefile.win

        from the command line?

        If that fails investigate makefile.win, which Dev generates. Post it is necessary.

        Clifford.

         
        • Anonymous

          Anonymous - 2004-04-23

          Sorry "Post it if necessary" of course.

           
    • Anonymous

      Anonymous - 2004-04-23

      Normally errors reported in standard headers are caused by whetever preceded the inclusion, but in your example it is the first line, so I guess not!

      The lines for which the errors are reported in stdio.h all reference a type called __VALIST, the error is being reported because it does not recognise this type. __VALIST is defined as a macro at line 135 as __gnuc_va_list which in turn is a typedef in Dev-Cpp\lib\gcc-lib\mingw32\3.2\include\stdarg.h, which should be included at line 44 of stdio.h.

      That is as much as I can tell you from the log you posted. You'll have to trace through the files to determine why __VALIST ends up undefined. A conflict with another compiler installation perhaps?

      Clifford

       
    • biterman

      biterman - 2004-04-23

      Well... if I run this from the prompt:

      C:\Dev-Cpp\bin>make -f "C:\Dario\Programming\test\Makefile.win" all

      I get this:

      C:\DEV-CPP\BIN\MAKE.EXE: *** No rule to make target `main.c', needed by `main.o'
      .  Stop.

      I really don't know what I'm looking for here, I've never worked with makefiles before... but anyways the contents of makefile.win are here (again this link will expire in 24 hours):

      http://rafb.net/paste/results/Do319454.html

      Thanks for the help :)

      adios,
      biterman.

       
    • aditsu

      aditsu - 2004-04-24

      add:
      -v --save-temps
      to the compiler options (in the tools menu)
      then compile the file again (as a single C file, not a project), and post the compile log and the resulting *.i file
      and don't forget to remove the -v --save-temps options afterwards

      Adrian

       
    • Anonymous

      Anonymous - 2004-04-24

      When running the makefile outside of the development environment you need to change directory to the location of the make file:

      cd C:\Dario\Programming\test
      make -fmakefile.win

      It is obviously not a problem with your code, since it compiles when you use the same command line that Dev-C++ is using. Moving one stage up, I am suggesting that you execute the makefile that Dev-C++ generates. If that works or otherwise is may indicate where we should look next. I'm looking for clues!

      Clifford.

       
    • biterman

      biterman - 2004-04-24

      With those options the compile log is this:

      /* Compile Log -v --save-temps */
      Compiler: Default compiler
      Executing  gcc.exe...
      gcc.exe "C:\Dario\Programming\test.c" -o "C:\Dario\Programming\test.exe"   -v --save-temps  -I"C:\DEV-CPP\include"   -L"C:\DEV-CPP\lib"
      Reading specs from C:\Program Files\JFE\gcc\bin\..\lib\gcc-lib\specs
      gcc version 2.95.2 19991024 (release)
      C:\Program Files\JFE\gcc\bin\..\lib\gcc-lib\cpp.exe -lang-c++ -v -IC:\DEV-CPP\include -iprefix C:\Program Files\JFE\gcc\bin\..\lib/gcc-lib/i386-mingw32\2.95.2\ -D__GNUC__=2 -D__GNUG__=2 -D__GNUC_MINOR__=95 -D__cplusplus -Di386 -D_WIN32 -DWIN32 -D__WIN32__ -D__MINGW32__=0.2 -DWINNT -D_X86_=1 -D__STDC__=1 -D__stdcall=__attribute__((__stdcall__)) -D_stdcall=__attribute__((__stdcall__)) -D__cdecl=__attribute__((__cdecl__)) -D__declspec(x)=__attribute__((x)) -D__i386__ -D_WIN32 -D__WIN32__ -D__WIN32__ -D__MINGW32__=0.2 -D__WINNT__ -D_X86_=1 -D__STDC__=1 -D__stdcall=__attribute__((__stdcall__)) -D___stdcall__=__attribute__((__stdcall__)) -D__cdecl=__attribute__((__cdecl__)) -D__declspec(x)=__attribute__((x)) -D__i386 -D__WIN32 -D__WINNT -D___stdcall=__attribute__((__stdcall__)) -Asystem(winnt) -Acpu(i386) -Amachine(i386) -D__EXCEPTIONS -remap -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__ C:\Dario\Programming\test.c test.ii

      GNU CPP version 2.95.2 19991024 (release) (80386, BSD syntax)
      #include "..." search starts here:
      #include <...> search starts here:
      C:\DEV-CPP\include
      C:\Program Files\JFE\gcc\bin\..\lib\gcc-lib\i386-mingw32\2.95.2\..\..\..\..\include
      End of search list.
      The following default directories have been omitted from the search path:
      /gcc-2.95.2/lib/gcc-lib/i386-mingw32/2.95.2/../../../../include/g++-3
      /gcc-2.95.2/lib/gcc-lib/i386-mingw32/2.95.2/../../../../i386-mingw32/include
      /gcc-2.95.2/lib/gcc-lib/i386-mingw32/2.95.2/include
      /usr/local/i386-mingw32/include
      End of omitted list.

      C:\Program Files\JFE\gcc\bin\..\lib\gcc-lib\cc1plus.exe test.ii -quiet -dumpbase test.cc -version -o test.s

      GNU C++ version 2.95.2 19991024 (release) (i386-mingw32) compiled by GNU C version 2.95.2 19991024 (release).
      In file included from C:\Dario\Programming\test.c:1:
      C:\DEV-CPP\include\stdio.h:216: type specifier omitted for parameter
      C:\DEV-CPP\include\stdio.h:217: type specifier omitted for parameter
      C:\DEV-CPP\include\stdio.h:218: type specifier omitted for parameter
      C:\DEV-CPP\include\stdio.h:219: type specifier omitted for parameter
      C:\DEV-CPP\include\stdio.h:224: type specifier omitted for parameter
      C:\DEV-CPP\include\stdio.h:224: parse error before `)'
      C:\DEV-CPP\include\stdio.h: In function `int vsnprintf(...)':
      C:\DEV-CPP\include\stdio.h:225: `s' undeclared (first use this function)
      C:\DEV-CPP\include\stdio.h:225: (Each undeclared identifier is reported only once

      C:\DEV-CPP\include\stdio.h:225: for each function it appears in.)
      C:\DEV-CPP\include\stdio.h:225: `n' undeclared (first use this function)
      C:\DEV-CPP\include\stdio.h:225: `format' undeclared (first use this function)
      C:\DEV-CPP\include\stdio.h:225: `arg' undeclared (first use this function)
      C:\DEV-CPP\include\stdio.h: At top level:
      C:\DEV-CPP\include\stdio.h:349: type specifier omitted for parameter
      C:\DEV-CPP\include\stdio.h:350: type specifier omitted for parameter
      C:\DEV-CPP\include\stdio.h:351: type specifier omitted for parameter
      C:\DEV-CPP\include\stdio.h:352: type specifier omitted for parameter
      C:\DEV-CPP\include\stdio.h:383: type specifier omitted for parameter
      C:\DEV-CPP\include\stdio.h:383: parse error before `)'

      Execution terminated

      /* End Compile log -v --save-temps */

      The test.ii file was way to long to post here so I posted it here:

      http://rafb.net/paste/results/i3128486.html

      I noticed some lines that seem to be including stuff from the files of this other small IDE I didn't even remember I had installed (JFE), heck I can't even remember where I got it.

      Could this be the reason for all the problems? If so should I just delete JFE?

      About the makefile, I added Dev's bin folder to my path and called make from the test dir and this is what I got:

      C:\Dario\Programming\test>make -fmakefile.win
      C:\DEV-CPP\BIN\MAKE.EXE: Nothing to be done for `all'.

      I have no idea what this all means...

      Thanks again for all the help :)

      adios,
      biterman.

       
    • Wayne Keen

      Wayne Keen - 2004-04-24

      Wait a minute.  You said in your opening post:

      "I'm having serious problems with Dev-C++ 5 (4.9.8.0 & 4.9.8.7) on a Win98SE machine."

      But what you just posted shows:

      GNU CPP version 2.95.2 19991024 (release) (80386, BSD syntax)

      2.95.2 is not part of 4.9.8.0 or 4.9.8.5 and

      C:\Program Files\JFE\gcc\bin\..\lib\gcc-lib\i386-mingw32\2.95.2\..\..\..\..\include

      You are still dealing with what appears to be your previous version.

      It looks to me like you still have traces lingering of your old install that is mixing badly with the new one.

      Wayne

       
    • biterman

      biterman - 2004-04-24

      Yeah, but how do I fix that? I have no idea.

      I've uninstalled/reinstalled Dev-Cpp following the instructions on the thread on that subject twice. Should I simply delete that "JFE" and try again? or what?

      Thanks..

      adios,
      biterman.

       
    • Wayne Keen

      Wayne Keen - 2004-04-24

      I would uninstall and delete *everything* that is associated with the existing version of Dev.  Think nuclear.  All directories that might have been set up in your previous installs should go away.

      If you have something like Norton Utilities or RegCleaner - use that.  Check out your autoexec.bat to see if there is anything in there.  Be ruthless.

      Wayne

       
    • biterman

      biterman - 2004-04-24

      Alright!
      I went "nuclear" like you suggested.
      I uninstalled Dev-Cpp with Norton Cleansweep 2003, did the same for that JFE IDE. Then went seek&destroy for anything having to do with gcc or devcpp or jfe in the registry with both RegCleaner and Norton Registry Editor. There was an entry that defined the path to gcc, it pointed to the jfe bin folder, that I'm guessing was the reason for all my problems.

      Proceed to reinstall and compilation went smooth :)

      Thanks alot for all the help guys!
      Couldn't have solved my probs without it :)

      adios,
      biterman.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.