Borland Compiler

This is a discussion on Borland Compiler within the C++ Programming forums, part of the General Programming Boards category; I Downloaded a Borlad C++ Compiler. I installed it and tried to run a simple program. #include <iostream.h> void main() ...

  1. #1
    Microsoft. Who? MethodMan's Avatar
    Join Date
    Mar 2002
    Posts
    1,198

    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?
    -MethodMan-

    Your Move:Life is a game, Play it; Life is a challenge, Meet it; Life is an opportunity, capture it.

    Homepage: http://www.freewebs.com/andy_moog/home.html

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    >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
    My best code is written with the delete key.

  3. #3
    Blank
    Join Date
    Aug 2001
    Posts
    1,034
    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.

  4. #4
    Registered User
    Join Date
    Apr 2002
    Posts
    362
    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
    "When the only tool you own is a hammer, every problem begins to resemble a nail." Abraham Maslow

  5. #5
    Registered User
    Join Date
    Dec 2001
    Posts
    108
    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"
    Last edited by DarkStar; 08-05-2002 at 09:28 PM.

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21