-
Borland Compiler
I Downloaded a Borlad C++ Compiler. I installed it and tried to run a simple program.
#include <iostream.h>
void main()
{
cout << "Hello, Testing";
}
So under Borland, BCC55, and Bin, I save the file as "test.cpp"
Under a console window, I go to the same place as above and type
bcc32 test.cpp, and I get the following errors
Error E2209 test.cpp 1: Unable to open include file 'iostream.h'
Error E2451 test.cpp 5: Undefined symbol 'cout' in function main()
*** 2 errors in Compile ***
Any Suggestions?
-
>Any Suggestions?
Don't use void main and use the current standard iostream header. If that doesn't work then you may have installed the compiler incorrectly.
Code:
#include <iostream>
int main()
{
std::cout << "Hello, Testing\n";
}
-Prelude
-
Try doing something like
bcc32 -Ic:\borland\include or something like that depending where the include directory is. If that compiles then you need to make sure that your include paths are set correctly in the config file.
-
With respect to Prelude's code, add #include <conio.h>, and place 'getch();' just before 'return 0;' prior to your ending brace.
Code:
#include <iostream>
#include <conio.h>
int main()
{
std::cout << "Hello, Testing\n";
getch();
return 0;
}
(Disregard that 'return 0;', being the default in C++, is unnecessary. It's good practice and it's good form.) :)
-Skipper
-
If you have installed the Borland compiler to C:\BORLAND\BCC55\ make sure you include these two lines in the bcc32.cfg file in the bin folder...
-I"c:\borland\bcc55\include"
-L"c:\borland\bcc55\lib;c:\borland\bcc55\lib\psd k"
In the ilink32.cfg file ( also in the bin folder ) include this line...
-L"c:\borland\bcc55\lib;c:\borland\bcc55\lib\psd k"