Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C++ and Visual C++ > C++ Programming
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
C++ Programming General discussions for the C++ language. For questions specific to Microsoft's Visual C++ variant, see the Visual C++ forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C++ Programming section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old January 5th, 2008, 02:27 AM
Registered User
 
Join Date: Jan 2008
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default C++ Unable to open include file.

I am working thru the Wrox book: Beginning Programming, and need some advice on getting a simple program to compile. I have Vista and use the free Borland C++ compiler. After entering in a simple C++ code, I was not able to get it to compile. When I attempted to compile the code, I received an E2209 error, the compiler was unable to open the include file 'iostream.h' In an attempt to troubleshoot the errors, I made some changes as follows using info from this site: http://dn.codegear.com/article/21205

A. Appended Environment Variables:
            1. Opened Control Panel.
            2. Navigated to System.
            3. Clicked on "Advanced System Settings".
            4. Clicked on the "Advanced" tab, to open the
                 "System Properties" window.
            5. Clicked on the "Environment Variables" button.
            6. Highlighted the "Path" System variable (bottom).
            7. Clicked on the "Edit" button.
            8. Appended the line with ";C:\BORLAND\BCC55\BIN;".
            9. Clicked OK (3 clicks) and exited the System Properties
                 window.

B. Set up the configuration files:
            1. From the command prompt, I changed directory to
                "C:\BORLAND\BCC55\BIN"

            2. Created the file BCC32.CFG. as follows:
                a) Typed "edit bcc32.cfg" [Enter].
                b) A blank window opened in the editor.
                c) Entered the 2 lines below into the blank window.
                    -I"c:\Borland\Bcc55\include"
                    -L"c:\Borland\Bcc55\lib"
                d) Created ILINK32.CFG in the same manner as above.
                    -L"c:\Borland\Bcc55\lib"
                e) Saved the files and exited the command prompt.
                f) Restarted Windows.

C. From Chapter 7 of Beginning Programming, I entered the following
    code into a text editor(EditPad Lite):


                // C++ code template
#include <iostream.h>
void main()
           {
    //code goes here
               }


D. I saved the file as "Template.cpp" in C:\Progs.

E. From the command prompt I entered the following:

     C:\borland\bcc55\bin\bcc32.exe C\Progs\Template.cpp

F. The output was as follows:

C:\Users\Allen>c:\borland\bcc55\bin\bcc32.exe c:\progs\template.cpp
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
c:\progs\template.cpp:
Error E2209 c:\progs\template.cpp 2: Unable to open include file 'iostream.h'
*** 1 errors in Compile ***


G. I have searched for the error and can't find it. My configuration
    files are properly located at C:\Borland\BCC55\Bin. I have tried
    experimenting with the appending in the Environment Variables
    window. I entered iostream with and without the "h", and get
    the same result.

Thanks in advance if you can help me out with this.

Allen

Reply With Quote
  #2 (permalink)  
Old January 5th, 2008, 08:04 PM
Registered User
 
Join Date: Jan 2008
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I found the error. It was not it the code or in the setup of the compiler. The error occurred at the command prompt level.

Problem: Can't compile code from cmd.exe even though logged on as administrator.

Solution: Set properties, 'Run as administrator'. In Vista, the requested operation requires elevation.
Reply With Quote
  #3 (permalink)  
Old June 1st, 2015, 05:28 PM
Registered User
Points: 3, Level: 1
Points: 3, Level: 1 Points: 3, Level: 1 Points: 3, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2015
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to easily compile c program without any error

If you unable to compile c program without any error don't worry here i provide you all clear and step by step guide with proper screenshots and i hope you found it useful click on below link to get full article.

http://www.extratipstricks.com/2015/...-programs.html
Reply With Quote
  #4 (permalink)  
Old June 9th, 2016, 07:19 AM
Registered User
Points: 9, Level: 1
Points: 9, Level: 1 Points: 9, Level: 1 Points: 9, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2016
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hey guys, i'm new to C++, using Turbo C++, whenever i try to compile my prg, it gives me an error saying - ""Unable to open include file
Reply With Quote
  #5 (permalink)  
Old July 7th, 2016, 01:43 PM
Registered User
Points: 3, Level: 1
Points: 3, Level: 1 Points: 3, Level: 1 Points: 3, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2016
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Roma Rosa
using Turbo C++, whenever i try to compile my prg, it gives me an error saying - ""Unable to open include file
Hi, it depends what kind of file you are unable to include. If it is one of the standard C++ files like:
Code:
#include <iostream.h>
then:
1. check if it is right typed (no errors in spelling)
2. check configuration in menu Options->Directories, it should contain right entry, for example if your Turbo C++ is installed in C:\TURBOC3\ the path in configuration window should start the same.

If it is a file that you created, for example "file.h", then it should be included like this:
Code:
#include "file.h"
(notice the quotation marks)
Or if it doesn't work, try full path, to this file, for example:
Code:
#include "C:\DIRECTORY_OF_YOUR_FILE/SUBDIRECTORY/file.h"
Sorry for my English.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to open excel file thru vb.net sreeramulu Javascript 5 December 6th, 2013 03:19 AM
Unable to open script file Pickle Dreamweaver (all versions) 1 October 31st, 2005 01:35 PM
Cannot open include file pedromecanica Visual C++ 4 February 14th, 2005 03:55 PM
unable to open flv file sentme_mail Flash (all versions) 0 December 27th, 2004 05:50 AM
unable to pass values from include file kuehhc Beginning PHP 1 June 8th, 2004 10:46 PM



All times are GMT -4. The time now is 08:26 PM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.