# Problem with include files using Borland's free C++ compiler



## vcol (Aug 15, 2005)

InterKnight recently asked something similar about Dev-C++ but it didn't seem to have the exact answer for the issue I'm facing, so hopefully someone can give me a more exact solution for my situation.

I'm trying to use the free Borland C++ command line tools (my Windows version is Win XP Pro -- I run a batch file to include the path to the Borland compiler main directory each time I open the command window to start the compiler) but with my first simple programs I can't include iostream successfully.

Here's an extremely simple example:

// A very simple program that should compile
#include <iostream>
using namespace std;

int main()
{

cout << "My first output line" << endl;

return 0;
}

The errors are:
Error E2209: Unable to open include file 'iostream'
Error E2282: Namespace name expected
Error E2451: Undefined symbol 'cout' in function main()

I have tried including both <iostream.h> and <iostream> and also tried specifying the \Include subdirectory for the compiler directly in my system PATH variable.

I also tried replacing 
include <iostream>
with
include "<full path>\iostream.h"
which seemed to get the iostream.h file included okay but then that led to the compiler throwing 3 new errors stating unable to open the nested includes being included by iostream:

stdcomp.h
istream
ostream

I created a bcc32.cfg file and an ilink32.cfg file in the compiler's \bin folder -- the ilink32.cfg file indicates the path to the Lib folder and the bcc32.cfg file indicates the path to the Include folder and the Lib folder. I thought that would be enough to tell the compiler where to find the include files.

Is there another setup step I need to do so the bcc32 compiler finds the include files as well as files that are sub-included by the includes?

Thanks!
vcol


----------



## elee (Dec 19, 2004)

Your code modified to compile. Take it from here.

// A very simple program that should compile
#include <iostream.h>
//using namespace std;

int main()
{

cout << "My first output line" << endl;

return 0;
}

//}


----------



## Kramer55 (Jan 18, 2005)

I don't think he needed help with the code; his version was fine.

He just wanted to use that as a demonstration.

Are you compiling the right type of program? What do you select when you create it (DOS, Windows, etc)?


----------

