Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

command line tools...

Status
Not open for further replies.

florescence

Programmer
Jan 7, 2001
1
CA
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 :cool:
 
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:
Code:
#include <iostream.h>

int main()
{
    // do something
    cout << &quot;Hello, world&quot; << 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 &quot;BCC32.CFG&quot; and &quot;iLink32.CFG&quot;. The first file needs two lines:
-I&quot;c:\Borland\Bcc55\include&quot;
-L&quot;c:\Borland\Bcc55\lib&quot;

The second file needs one line:
-L&quot;c:\Borland\Bcc55\lib&quot;

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.
 
by using the code:
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
 
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 &quot;Hello, World.&quot;

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.
 
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top