Sunday, July 12, 2009

Help for c++?

I have started studying C++ on my own with Turbo C++ by Robert lafore.


I typed a simple program from the book on the IDE





#include%26lt;iostream.h%26gt;





void main()


{


cout%26lt;%26lt;"Every age has a language of its own";


}





when i try to compile the above program it gives the following error


"unable to include file iostream.h"





what should i do to troubleshoot the problem

Help for c++?
go to options nd check ur directiories nd change the local disk(d,e,f,g) apropriately.......
Reply:There's no problem with your program.





The problem is with your compiler.


It is not able to find the header files(in this case iostream.h)





open your compiler. Click options-%26gt;directories.


Then in the "include directory" column,


Enter the path to the header files.


(The files with .h extensions. Some are iostream.h


conio.h graphics.h)





suppose you have you header files at C:\programs\turboC\include.





Then type that path in that column.





Similarly you can see three other columns. The next one is library column. It is used to link you programs.


Enter the path where .bgi and .chr files are found in that place.





The next column is for where to place the output file.


The exe file created by compiler. You can place it anywhere. Similarly the fourth.





Then restart the compiler.





Hope this will work.if you have further problems mail me using yahoo answers.
Reply:i also had the same problem when i started learning.All u need to do is above u r screen (where u have file,edit,...etc.)u will see 'options', click,go to directories,click,u will see C/:TC(sumthing like dis).Just change that,if its C then delete it %26amp; change it to D %26amp; if its D vice-versa.
Reply:If that other stuff doesn't work try:





#include %26lt;iostream%26gt;





That's the new-fangled way to do header files, without the '.h'.
Reply:1) Change #include %26lt;iostream.h%26gt; to #include "iostream.h"


2) Do a search for the file "iostream.h", and copy it to your program directory.


3) Change preferences in Turbo C++ to include the directory where iostream.h was found. The directory needs to be included in the include directories list.





Do one or all 3 to resolve issue.
Reply:hello friend





this is a very common problem


1.See weather iostream.h file is in ur include folder.


2.If u didnt install the C++ in C drive then also this problem may occur.





3.So if u installed in another drive then in #include%26lt; %26gt;


give the entire path of the file





Ex: #include "c:\tc\include\iostream.h"





this will work path may wary





hope this helped u





goodluck





bye
Reply:you can go in option or window menu and then chose directories option and change it where your c++ setup is situated. like


c:\turbo cpp\


No comments:

Post a Comment