views:

500

answers:

4
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 ***
+2  A: 

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

oggy
+2  A: 

Seiously, @Delerium, 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.

Download Microsoft Visual C++ Express and install it. It's as free as the Borland one and substantially more up to date.

See here for the product page or here for the C++ product.

These are the web-based installers, you may want the ISO image at the bottom of this page if you want to install on multiple computers or keep a copy. It's 800M but well worth it.

paxdiablo
A: 

"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;
}
Evan Teran
Borland C++ 5.5 is "legacy"
Osama ALASSIRY
indeed, he should definitely get a compiler made this decade :-P.
Evan Teran
A: 

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.

Cristian Adam