[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Mixed C/C++ bug - g++-3.2_3.2.1-0pre4 (unstable)



In C++, you should include <cstdio> rather than <stdio.h>.  Additionally, mixing of stdio and iostream is not recommended, especially if you're going to use them both on the same stream.

Levi

On Wed, 23 Oct 2002 16:53:58 -0500 (CDT)
John Dahlstrom <jodaman@cegt201.bradley.edu> wrote:

> While 3.2.1-0pre3 works fine, 3.2.1-0pre4 fails.
> Given input file test.cpp:
> 
> #include <stdio.h>
> #include <iostream>
> using std::cerr;
> using std::endl;
> 
> int main()
> {
>   fprintf(stderr, "test\n");
>   fflush( stderr );
>   cerr << "test" << endl;
> }
> 
> 
> 
> $ g++ test.cpp -o test
> In file included from test.cpp:1:
> /usr/lib/gcc-lib/i386-linux/3.2.1/include/stdio.h:55: syntax error before
> `
>    typedef'
> /usr/lib/gcc-lib/i386-linux/3.2.1/include/stdio.h:60: `FILE' was not
> declared
>    in this scope
> /usr/lib/gcc-lib/i386-linux/3.2.1/include/stdio.h:71: parse error before `
>    typedef'
> In file included from test.cpp:1:
> /usr/lib/gcc-lib/i386-linux/3.2.1/include/stdio.h:97: syntax error before
> `
>    typedef'
> /usr/lib/gcc-lib/i386-linux/3.2.1/include/stdio.h:103: syntax error before
> `
>    typedef'
> In file included from test.cpp:1:
> [...]
> 
> 
> -- 
> To UNSUBSCRIBE, email to debian-testing-request@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> 


-- 
Levi Bard
levi@bard.sytes.net
http://bard.sytes.net
GooSNES - Lightweight, featureful GTK+ snes9x frontend - http://bard.sytes.net/goosnes/
TakCD - highly embeddable commandline cd player - http://bard.sytes.net/takcd/



Reply to: