Question

C:\BORLAND\BCC55\BIN>bcc32 hello.cpp
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
hello.cpp:
Error E2209 hello.cpp 2: Unable to open include file 'iostream'
Error E2090 hello.cpp 6: Qualifier 'std' is not a class or namespace name in fun
ction main()
Error E2379 hello.cpp 6: Statement missing ; in function main()
*** 3 errors in Compile ***

I'm veeery sad, you see! :-(

@oggy: I read the instructions at Embarcadero. Now, it says...

#include <iostream.h>
int main(void)
{
    cout << "Hello." << endl;
    return 0;
}

C:\Borland\BCC55\Bin\MySource>bcc32 hello.cpp
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
hello.cpp:
Error E2209 hello.cpp 1: Unable to open include file 'iostream.h'
Error E2451 hello.cpp 4: Undefined symbol 'cout' in function main()
Error E2451 hello.cpp 4: Undefined symbol 'end' in function main()
Error E2379 hello.cpp 4: Statement missing ; in function main()
*** 4 errors in Compile ***
Was it helpful?

Solution

Seriously, you're going to keep having troubles if you continue to use Borland's compiler. It's free from their computer museum for a reason - it's ancient. The copyright line itself should be proof enough of that:

Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland

Do you really want a compiler that hasn't been updated in decades, one that the standard has long since left behind?

It's the compiler you get if you're interested in vintage computing stuff, in the same league as people with TRS-80 and Apple II emulators :-)

Download Microsoft Visual C++ Express and install it. It's as free (as in cost) as the Borland one and substantially more up to date. See here for the product page.

Or there are many other more up-to-date development tools you can get for free as well, such as gcc, Code::Blocks and so forth.

OTHER TIPS

The first error would suggest that you didn't bother to read the installation instructions.

If you want to stick to Borland products you can install Turbo C++. I'm talking about the 2006 Turbo C++ part of the "Turbo Explorer" effort to bring back some of the popularity of the 90's Turbo C++.

They brag with "Turbo C++ contains support for the industry standard ANSI C and ISO/ANSI C++ languages and libraries. Turbo C++ also includes the Dinkumware C++ runtime libraries and support for the popular Boost library."

I think that a 2006 implementation should be decent enough, somehow not so popular like Visual Studio Express 2005/2008.

Regarding the compilation problems, one must fiddle with the two configuration files found in the bin directory (in this case C:\BORLAND\BCC55\BIN), namely bcc32.cfg and ilink32.cfg. The compiler cannot find the iostream.h file.

**create two file inside C:\Borland\bcc55\bin

edit its info with following** in file BCC32.cfg

      -I"c:\Borland\Bcc55\include"

      -L"c:\Borland\Bcc55\lib"

Create another file with name ILINK32.cfg

      -L"c:\Borland\Bcc55\lib"

now use your compiler and don't forget to add

      #include<iostream>

      using namespace std;

at heading section.

"iostream.h" is not a standard c++ header, some compilers provide it for legacy support, but you should always use just "iostream" instead. The main difference between the legacy and the standard one is the std namespace. To have a compliant version of your example, it would look like this:

#include <iostream>
using namespace std; // import the contents of the std namespace 
                     // into the global namespace

int main() {
    cout << "Hello." << endl;
    return 0;
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top