public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* GCC 4.0.1 - iostream: No such file or dir....
@ 2005-08-06  4:52 Chris Garrett
  0 siblings, 0 replies; 5+ messages in thread
From: Chris Garrett @ 2005-08-06  4:52 UTC (permalink / raw)
  To: gcc

I finally got 4.0.1 built in msys. I must have screwed up my msys/gcc 
setup because a clean install of msys and gcc-3.4.1 worked. I started 
with a simple test:

main.cpp:
~~~~~~~~~~~~~~~~~~~~~~~~~~
#include <iostream>

int main()
{
        cout << "Hello\n";
        return 0;
}


then I try and build it:
~~~~~~~~~~~~~~~~~~~~~~~~~~
chris@NEPTUNE /d/tmp/simple$ g++ main.cpp -o main
main.cpp:1:20: error: iostream: No such file or directory
main.cpp: In function 'int main()':
main.cpp:5: error: 'cout' was not declared in this scope

I looked thru in /mingw/include/c++/4.0.1 and iostream exists in that 
directory. Is there something I'm missing? Do you need to specify gcc's 
include directories explicitly now?

Thank you

Chris


My system details:
WinXP Pro
GCC 3.4.1
Msys


config cmd:
~~~~~~~~~~~~~~~~~~~~~~~~~~
../gcc-4.0.1/configure \
        --prefix=/mingw \
        --with-gcc \
        --with-gnu-ld \
        --with-gnu-as \
        --enable-threads \
        --disable-shared \
        --disable-nls \
        --enable-languages=c,c++,f95 \
        --disable-win32-registry \
        --with-gmp=/usr/local/gmp-4.1.4


make cmd:
~~~~~~~~~~~~~~~~~~~~~~~~~~
make \
        CFLAGS="-O2 -march=i686 -fomit-frame-pointer" \
        CXXFLAGS="-mthreads -O2 -march=i686 -fomit-frame-pointer" \
        LIBCFLAGS="-O2" \
        LIBCXXFLAGS="-O2 -fno-implicit-templates" \
        LDFLAGS="-s" \
        bootstrap






^ permalink raw reply	[flat|nested] 5+ messages in thread
* re: GCC 4.0.1 - iostream: No such file or dir....
@ 2005-08-06 15:49 dank
  2005-08-07 20:19 ` Chris Garrett
  0 siblings, 1 reply; 5+ messages in thread
From: dank @ 2005-08-06 15:49 UTC (permalink / raw)
  To: gcc; +Cc: cgarrett

Chris Garrett <cgarrett@degarrah.com> wrote:
> main.cpp:5: error: 'cout' was not declared in this scope

This question should have been sent to gcc-help, not here.

But as long as I'm answering:

It's std::cout now, according to the C++ standard.
If you want to compile old code that wasn't aware of std,
you can stick
  using namespace std;
at the top.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-08-08 17:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-06  4:52 GCC 4.0.1 - iostream: No such file or dir Chris Garrett
2005-08-06 15:49 dank
2005-08-07 20:19 ` Chris Garrett
2005-08-08  4:10   ` Mike Stump
2005-08-08 17:40     ` Chris Garrett

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).