help-gplusplus
[Top][All Lists]
Advanced

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

Re: gcc cant find iostream


From: Erik Sigra
Subject: Re: gcc cant find iostream
Date: Mon, 16 Jul 2001 14:55:19 +0200

måndagen den 16 juli 2001 12:46 skrev Jürgen Eisele:
> Hi,
> I use the gcc compiler under SuSE-Linux 7.1. I have trouble using commands
> from the iostream library.
> When writing e.g.
>
> #include <iostream.h>
>  main()
> {
> cout << "Something";
> }
>
> and compiling with gcc -o out out.cc -liostream
>
> I get the error message:
> /usr/i486-suse-linux/bin/ld cannot find -liostream
> and omitting the -liostream the error message is:
> undefined reference to cout.
>
> So the compiler cannot find the iostream library, which however there and
> is located in usr/include/g++/
>
> Do you know how to make the compiler find the library?
> Any help is greatly appreciated, thanks in advance.

Here is an example that works for me:

Makefile:
---------------------------------------------------------------------------
hello: hello.cc
        g++ -Wall -Woverloaded-virtual -ansi -pedantic -O hello.cc -o hello
 
clean:
        rm -f hello
---------------------------------------------------------------------------

hello.cc:
---------------------------------------------------------------------------
#include <iostream>
 
int main()
{
  std::cout<< "Hello, world!\n";
}
---------------------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]