#include<iostream>/how to insert library

Hi,
when I try to create a program "Hello world", my compiler says, that I dont have the libray or can't find <iostream>/ <iostream.h>.
I tryed with different compilers, now I am working with pelles but I cant find librares and I dont know how to insert them in the compiler???
Thank you in advance!
by compiliers do you mean compiliers or IDE's ??

There are many hundreds of thousands of IDE's which are simply a graphical text editors.
Not quite as many compilers, more common compilers are GNU/mingw and borland-C.
If you are a windows user you can download mingw, which is the windows version of gnu. borland C (i have never use before). and simply use a basic text editor to start with(like wordpad or download a more advanced editor like notepad++), and use the command prompt to compile and run your programs. Another IDE you can use is DEVC, which I think may also have a compiler with it when you download and install, although I have never used this either.


If you are using linux/bsd/solaris/unix then you can use GNU. gnu.org

if your using MAC, then throw your computer out the window and buy a real pc... :P jokes, seriously though I'm not sure, I would guess GNU, as mac is mostly a ripoff of unix anyway.
Last edited on
I am usin WinXp ,
but if i wrote the program in Notepad and then run it with the console, what will hapen with <iostream>???
when you compile your code using g++ *.cpp the compiler makes an executable usually called a.exe but depends on the compiler and depends on input args you give the compiler. But as an example lets say you write: g++ filename.cpp ( then the compiler will make an a.exe )
at the start of your code your simply write the following
1
2
3
4
5
6
7
8
9

#include <iostream>
using namespace std;

int main()
{

   ... // stuff in main
}


then to run the executable you simply type in cmd window: ./a.exe

also using notepad is bad, download notepad++ it's cool. Or if you don't want to waste bandwith use wordpad.
Last edited on
error #1035: Can't find include file <iostream>


that's my problem and i am using Pelles compiler but with other copilers,problem is the same!
I think I need libraries but I cant insert them in my compilers!
Are you sure that your compiler works for C++ and it isn't just for C?
Which options are you passing to the compiler?
That's why i suggested downloading, GNU or borland

are you using notepad/cmd to compile or an IDE?
Last edited on
It's also possible this is just a path error, the compiler you use you might need to set in the windows environment variables, which are in Control Panel -> System -> advanced -> Environment Variables

click PATH then edit, then append NOT DELETE, APPEND to the end of the path line:

;C:\Directory\to\compiler's\bin\directory

But then it shouldn't say can't find the iostream, it should just not work in general if that was the case.

EDIT: and I finally just looked up the Pelles Compiler, which amazingly is an IDE, with small C compiler included in d/l.
C not same as C++

EDIT2:
try this: http://www.bloodshed.net/dev/devcpp.html devcpp
and: http://notepad-plus.sourceforge.net/uk/site.htm notepad++
and: http://www.cygwin.com/ cygwin
and: http://www.mingw.org/ mingw
and: http://www.codegear.com/downloads/free/cppbuilder borland junk

if you download mingw, or preferably cygwin. cygwin contains just about every utility Linux OS's do except they run from within windows much like cmd prompt, but with power.

I havn't used mingw before but from the looks of the download page, a lot of it is borrowed from cygwin anyway. I suggest if you want to learn about linux which is written in C/C++ download cygwin, if you just want an IDE that compiles with a click of the button use DEVCPP.
Last edited on
Topic archived. No new replies allowed.