Thread: quick question on compiling

  1. #1
    Registered User
    Join Date
    Aug 2002
    Posts
    21

    quick question on compiling

    borland builder 5.5. I have a question on compiling. I have all the source written out in a .cpp file. I am wondering, what's the best way to compile and run the program? Should I compile and run it at the same time, or create an EXE file and then run that?

    Also, in the builder, when I run the compiler, like this:

    cpp32.exe program.cpp

    will it just compile it, or will it compile it and run it, or will it just compile it and link it automatically?

    Thanks for any advice. I'm a little confused about everything.

  2. #2
    Registered User
    Join Date
    Aug 2002
    Posts
    21

    may have figured it out...?

    not sure though. I have a premade test program my teacher made, and I'm trying to run it with bcc32.exe.........

    I keep getting these errors...

    Code:
    Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
    C:\Borland\BCC55\Bin\bobdole.cpp:
    Error E2209 C:\Borland\BCC55\Bin\bobdole.cpp 5: Unable to open include file 'iostream'
    Error E2282 C:\Borland\BCC55\Bin\bobdole.cpp 7: Namespace name expected
    Error E2451 C:\Borland\BCC55\Bin\bobdole.cpp 19: Undefined symbol 'cout' in function Watertank::displayData()
    Error E2451 C:\Borland\BCC55\Bin\bobdole.cpp 19: Undefined symbol 'endl' in function Watertank::displayData()
    Error E2451 C:\Borland\BCC55\Bin\bobdole.cpp 25: Undefined symbol 'cout' in function Watertank::getData()
    Error E2451 C:\Borland\BCC55\Bin\bobdole.cpp 26: Undefined symbol 'cin' in function Watertank::getData()
    Error E2451 C:\Borland\BCC55\Bin\bobdole.cpp 35: Undefined symbol 'cout' in function Watertank::getArea()
    Error E2451 C:\Borland\BCC55\Bin\bobdole.cpp 35: Undefined symbol 'endl' in function Watertank::getArea()
    Error E2451 C:\Borland\BCC55\Bin\bobdole.cpp 40: Undefined symbol 'cout' in function Watertank::getGallons()
    Error E2451 C:\Borland\BCC55\Bin\bobdole.cpp 40: Undefined symbol 'endl' in function Watertank::getGallons()
    Error E2451 C:\Borland\BCC55\Bin\bobdole.cpp 46: Undefined symbol 'cout' in function main()
    Error E2451 C:\Borland\BCC55\Bin\bobdole.cpp 46: Undefined symbol 'endl' in function main()
    Error E2451 C:\Borland\BCC55\Bin\bobdole.cpp 52: Undefined symbol 'cin' in function main()
    *** 13 errors in Compile ***
    
    Tool completed with exit code 1
    anyone have any advice or any information on what is going wrong?


    Code:
    /* ================================================================== */
    /* >  Program:      tank1.cpp                                       < */
    /* >  Description:  OPP and simple classes                          < */
    /* ================================================================== */
    #include <iostream>
    
    using namespace std;
    
    #define TITLE "Watertanks"
    #define PI 3.14
    
    class Watertank
      {
      private:
         float radius, height, area, gallons, cover;
      public:
         void displayData()
            {
             cout << "\nThe watertank has a radius of " << radius << endl;
             cout << "The watertank has a height of " << height << endl;
             cout << "The paint coverage is " << cover << endl;
            }
         void getData()
            {
             cout << "Enter tank radius in feet: ";
             cin >> radius;
             cout << "Enter tank height in feet: ";
             cin >> height;
             cout << "Enter the paint coverage: ";
             cin >> cover;
            }
         void getArea()
            {
             area = 2 * PI * radius * (radius + height);
             cout << "The surface area is " << area << endl;
            }
         void getGallons()
            {
            gallons = area / cover;
            cout << "The paint gallons needed are " << gallons << endl;
            }
      };
    main()
    {
       Watertank tank;
    cout << TITLE << endl << endl;
    tank.getData();
    tank.displayData();
    tank.getArea();
    tank.getGallons();
    cout << "\nPress ENTER to continue " << endl;
    cin.ignore();
    cin.get();
    return 0;
    }

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    Yeah, read the readme file again, and skip down to where it tells you to create a pair of ".cfg" files.
    IIRC, this is also a FAQ question
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Very quick math question
    By jverkoey in forum A Brief History of Cprogramming.com
    Replies: 8
    Last Post: 10-26-2005, 11:05 PM
  2. very quick question.
    By Unregistered in forum C++ Programming
    Replies: 7
    Last Post: 07-24-2002, 03:48 AM
  3. quick question
    By Unregistered in forum C++ Programming
    Replies: 5
    Last Post: 07-22-2002, 04:44 AM
  4. Quick Question Regarding Pointers
    By charash in forum C++ Programming
    Replies: 4
    Last Post: 05-04-2002, 11:04 AM
  5. Quick question: exit();
    By Cheeze-It in forum C Programming
    Replies: 6
    Last Post: 08-15-2001, 05:46 PM