×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

command line tools...

command line tools...

command line tools...

(OP)
hi, I'm a newbie to C and I'm using Borland C++ 5.02, so problem is that whenever I try to compile a program, the MS DOS prompt screen flashes and then disappears, does anyone know how to fix this?  I know it says in the readme file, but I don't really understand..it goes something like this:

Installing and running the Command Line Tools
-----------------------------------------------

1. Run freecommandlinetools.exe; choose the
   drive and folder into which you want to
   install the free C++Builder 5 command line
   tool development system.
   
2. From the bin directory of your installation:
   a. Add "c:\Borland\Bcc55"
      to the existing path
   b. Create a bcc32.cfg file which will set
      the compiler options for the Include
      and Lib paths (-I and -L switches to
      compiler) by adding these lines:
      -I"c:\Borland\Bcc55\include"
      -L"c:\Borland\Bcc55\lib"
   c. Create an iLink32.cfg file which will set
      the linker option for the Lib path by
      adding this line:
      -L"c:\Borland\Bcc55\lib"


If anyone could help translate this, I would really appreciate it!  THanks
Jen

RE: command line tools...

You mentioned that you have 5.02 but the instructions you give are for 5.5. Did you upgrade?

There are a couple of ways to "fix" the disappearing DOS screen. One is to add a line of code that will ask for user input before the screen closes. For example:

#include <iostream.h>

int main()
{
    // do something
    cout << "Hello, world" << endl;

   // user must enter a letter or number followed by ENTER before program finishes.
    char v;
    cin >> v;
    return 0
}


You could use getchar or whatever your favorite library is.

Another way is to use the command line compiler instead of an IDE. I'll use BCC5.5 as an example since the instructions you list is for this compiler. Assuming that your compiler is in C:\Borland\BCC55\bin, your libraries are in C:\Borland\BCC55\lib and your include files are in C:\Borland\BCC55\include. I'll also assume that the file you want to compile is MyFile.cpp. You could compile the file like this:
C:\Borland\BCC55\bin\bcc32 -IC:\Borland\BCC55\include -LC:\Borland\BCC55\lib MyFile.cpp

This would produce MyFile.obj and MyFile.exe. This is a lot to type if you want to compile your program alot for testing. The way described in your instructions is to add the C:\Borland\BCC55\ to your path. In C:\Borland\BCC55 you will need to create two files "BCC32.CFG" and "iLink32.CFG". The first file needs two lines:
  -I"c:\Borland\Bcc55\include"
  -L"c:\Borland\Bcc55\lib"

The second file needs one line:
  -L"c:\Borland\Bcc55\lib"

This way, to compile your file you only need to type: bcc32 MyFile.cpp .

James P. Cottingham

I am the Unknown lead by the Unknowing.
I have done so much with so little
for so long that I am now qualified
to do anything with nothing.

RE: command line tools...

by using the code:
char v;
cin >> v;

(that is, if I'm not totaly wrong) you take up memory by allocationg space for a char!!
I prefer to use:
cin.get() // and wait for user to press the return key

My codes look like something a kid wrote
I have absolutely no idea what I am talking about
Somehow I still manage to make it work

RE: command line tools...

801119,

No, you are right, you would use one address for a character but for such a small program does it matter ? You method is probably better for longer programs or programs that acutally do more than print "Hello, World."

James P. Cottingham

I am the Unknown lead by the Unknowing.
I have done so much with so little
for so long that I am now qualified
to do anything with nothing.

RE: command line tools...

2ffat,

Well, perhaps not... but then again, why waste good memory?! in both your and my example the user must press the enter key, thus the use of variables has no point!

...A thought of mine...

My codes look like something a kid wrote
I have absolutely no idea what I am talking about
Somehow I still manage to make it work

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close