9 Replies - 5731 Views - Last Post: 28 December 2011 - 01:45 AM Rate Topic: -----

#1 Ghost_programmer1  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 19-October 09

how to use borland compiler 5.5?

Posted 04 March 2010 - 07:07 AM

earlier i used xp and used turboc to compile and run my c programs? now how do i use bcc55?
Is This A Good Question/Topic? 0
  • +

Replies To: how to use borland compiler 5.5?

#2 besten  Icon User is offline

  • New D.I.C Head

Reputation: 12
  • View blog
  • Posts: 40
  • Joined: 03-March 10

Re: how to use borland compiler 5.5?

Posted 04 March 2010 - 07:27 AM

Try this :D
http://www.webnotes.org/bcc55eng.htm
Will give you a good grasp about it. It's better to google first, so you learn how to learn :D
Good luck
Was This Post Helpful? 2
  • +
  • -

#3 NickDMax  Icon User is offline

  • Can grep dead trees!
  • member icon

Reputation: 2250
  • View blog
  • Posts: 9,245
  • Joined: 18-February 07

Re: how to use borland compiler 5.5?

Posted 04 March 2010 - 09:42 AM

*
POPULAR

Well its pretty simple.

Here is how I have things setup:

I have BCC installed to C:\BCC5.5\
That gives me the basic folder structure of

C:\BCC55\
....\bin --where all of the .exe are located
....\include --where all of the standard headers are located
....\lib --where all of the standard libraries are located


Step #1: Path
The first thing you should do is to add C:\BCC5.5\bin to your path. Right click on "My Computer" and choose "properties" then click on the "advanced" tab. Click the button at the bottom "Environment Variables" and add the bin directory to your path.

Step #2: Bcc32.cfg
The next thing you will want to do is configure the compiler to know where everything is.
In the bin directory create (or edit if it already exits) the bcc32.cfg file:

use -I to add include directories
use -L to add library directoryies

So for example I have the following:
-I"C:\BCC55\Include";"C:\CProjects\boost_1_39_0"
-L"C:\BCC55\lib"
-O2
-6


Though all you should need is the include directory and the lib directory added.

The -O2 is for optimizations (which I have on by default)
the -6 is for the pentium pro processor (Borland 5.5 is a bit old)

Step #3: ilink32.cgf
You really should not need this file, but I have:
-L"C:\Borland\BDS\4.0\lib"


Step #4: Sample program:

In a command console window go to a sample project directory (or a temp directory) and type the following:
copy con hello.cpp
#include <iostream>

int main() {
    std::cout << "hello world" << std::endl;
    return 0;
}

Press CTRL+Z when you are done

Then type: bcc32 hello.cpp

You should see something like this:
C:\BCC55\Bin>bcc32 hello.cpp
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
hello.cpp:
Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland


Step #5: Getting an Editor:

Writing programs from the command console or notepad sucks. I recommend getting an editor such as Programmer's Notepad

After installing launch the program. Goto the menu "Tools" and choose "options"
At the bottom select the "Tools" node (we will add our compiler to the tools)
Set the scheme choose: C/C++
Press the "Add" button: Fill out the form:
....Name: BorlandCompile
....Command: C:\BCC55\bin\bcc32.exe
....Folder: %d
....Parameters: "%d%f"
....Short Cut: F5
....Save: Current File
On the "Console I/O" form select: Capture output: use the main output window and "Clear output before running"
use the built in error parser (it will let you double click on errors to goto the line with the error).

Since you are interested in assembly language I also suggest adding another tool:
....Name: BCompile2Asm
....Command: C:\BCC55\bin\bcc32.exe
....Folder: %d
....Parameters: -S -c "%d%f"
....Short Cut: (whatever you may want)
....Save: Current File

And another tool that is nice to have is:
....Name: Run Program (local)
....Command: %d%n.exe
....Folder: %d
....Parameters: %?
....Short Cut: F6
....Save: None
In the console IO you can choose to capture (that is what I do) -- not if you capture you can't use input so I also create a second one without capture

When you are done press OK

Then create a new file Ctrl+N
Choose the schema "C/C++" (if you look at the top there is drop down that says "Plain Text" -- set that to C/C++) -- note you can skip this step, PN will set this when you save.
Type:
#include <iostream>

int main() {
    std::cout << "Hello World" << std::endl;
    return 0;
}


Save As -- remember to add a .cpp

Then press F5 to compile
Press F6 to run. (when you run it will give you a box for command line options just press enter or OK)
Was This Post Helpful? 5
  • +
  • -

#4 Ghost_programmer1  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 19-October 09

Re: how to use borland compiler 5.5?

Posted 08 March 2010 - 09:43 AM

thanks to both, everything worked fine.anyway i hane a doubt: is there a file called "algorithm"? i have one with the name of "algorith" not "algorithm".
if it exists, can somebody pls. pass it on?
Was This Post Helpful? 0
  • +
  • -

#5 sarmanu  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 966
  • View blog
  • Posts: 2,362
  • Joined: 04-December 09

Re: how to use borland compiler 5.5?

Posted 08 March 2010 - 09:56 AM

I have never used Borland, so I downloaded it (version 5.5). I searched through ./include folder, and indeed, there's only an "algorith.h". However, when I took a look at the examples the downloaded package provided, I saw that they were using:
#include <algorithm>


I don't know how this works. But try it.

This post has been edited by sarmanu: 08 March 2010 - 10:06 AM

Was This Post Helpful? 0
  • +
  • -

#6 Ghost_programmer1  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 19-October 09

Re: how to use borland compiler 5.5?

Posted 08 March 2010 - 10:08 AM

well i tried that and it showed something like unable to open input file algorithm. that's why i asked someone to pass it on. anyway, can u pls tell me more on why not to use Borland?
Was This Post Helpful? 0
  • +
  • -

#7 sarmanu  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 966
  • View blog
  • Posts: 2,362
  • Joined: 04-December 09

Re: how to use borland compiler 5.5?

Posted 08 March 2010 - 10:14 AM

Well, in my opinion, Borland is no better that Microsoft Visual C++. It does not even has an IDE (at least version 5.5). However, Borland C++ is not Turbo C or any other ancient Compiler. It is kinda new, and it supports the standard header files, like <iostream> and such. Nothing wrong if you want to use it, but I warmly recommend you Microsoft Visual C++ Express Edition, which comes with a great IDE, and it is free. Download it from here: http://www.microsoft...2008-Visual-CPP
Was This Post Helpful? 0
  • +
  • -

#8 NickDMax  Icon User is offline

  • Can grep dead trees!
  • member icon

Reputation: 2250
  • View blog
  • Posts: 9,245
  • Joined: 18-February 07

Re: how to use borland compiler 5.5?

Posted 08 March 2010 - 12:14 PM

Try making a copy of algorith.h called algorithm (no .h) -- leaving it in your include directory.

Another thing you might try doing is using another STL library. For example Apache STDCxx -- though I am not sure how compatable it will be with Borland 5.5
Was This Post Helpful? 0
  • +
  • -

#9 NickDMax  Icon User is offline

  • Can grep dead trees!
  • member icon

Reputation: 2250
  • View blog
  • Posts: 9,245
  • Joined: 18-February 07

Re: how to use borland compiler 5.5?

Posted 19 March 2010 - 07:52 AM

Note I just found an open source port of STL that is compatible with Borland 5.5 (STL'Port)... if you look at their list of supported platforms they have advice on how to get it to work on Borland 5.5 (basically looks like some namespace issues and setting up the include path). Of course I am sure the OP has probably moved on, but I thought I would just add this to the thread in case anyone else is looking.
Was This Post Helpful? 0
  • +
  • -

#10 GerardC  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 28-December 11

Re: how to use borland compiler 5.5?

Posted 28 December 2011 - 01:45 AM

View PostNickDMax, on 04 March 2010 - 09:42 AM, said:

Well its pretty simple.

Here is how I have things setup:

I have BCC installed to C:\BCC5.5\
That gives me the basic folder structure of

C:\BCC55\
....\bin --where all of the .exe are located
....\include --where all of the standard headers are located
....\lib --where all of the standard libraries are located


Step #1: Path
The first thing you should do is to add C:\BCC5.5\bin to your path. Right click on "My Computer" and choose "properties" then click on the "advanced" tab. Click the button at the bottom "Environment Variables" and add the bin directory to your path.

Step #2: Bcc32.cfg
The next thing you will want to do is configure the compiler to know where everything is.
In the bin directory create (or edit if it already exits) the bcc32.cfg file:

use -I to add include directories
use -L to add library directoryies

So for example I have the following:
-I"C:\BCC55\Include";"C:\CProjects\boost_1_39_0"
-L"C:\BCC55\lib"
-O2
-6


Though all you should need is the include directory and the lib directory added.

The -O2 is for optimizations (which I have on by default)
the -6 is for the pentium pro processor (Borland 5.5 is a bit old)

Step #3: ilink32.cgf
You really should not need this file, but I have:
-L"C:\Borland\BDS\4.0\lib"


Step #4: Sample program:

In a command console window go to a sample project directory (or a temp directory) and type the following:
copy con hello.cpp
#include <iostream>

int main() {
    std::cout << "hello world" << std::endl;
    return 0;
}

Press CTRL+Z when you are done

Then type: bcc32 hello.cpp

You should see something like this:
C:\BCC55\Bin>bcc32 hello.cpp
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
hello.cpp:
Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland


Step #5: Getting an Editor:

Writing programs from the command console or notepad sucks. I recommend getting an editor such as Programmer's Notepad

After installing launch the program. Goto the menu "Tools" and choose "options"
At the bottom select the "Tools" node (we will add our compiler to the tools)
Set the scheme choose: C/C++
Press the "Add" button: Fill out the form:
....Name: BorlandCompile
....Command: C:\BCC55\bin\bcc32.exe
....Folder: %d
....Parameters: "%d%f"
....Short Cut: F5
....Save: Current File
On the "Console I/O" form select: Capture output: use the main output window and "Clear output before running"
use the built in error parser (it will let you double click on errors to goto the line with the error).

Since you are interested in assembly language I also suggest adding another tool:
....Name: BCompile2Asm
....Command: C:\BCC55\bin\bcc32.exe
....Folder: %d
....Parameters: -S -c "%d%f"
....Short Cut: (whatever you may want)
....Save: Current File

And another tool that is nice to have is:
....Name: Run Program (local)
....Command: %d%n.exe
....Folder: %d
....Parameters: %?
....Short Cut: F6
....Save: None
In the console IO you can choose to capture (that is what I do) -- not if you capture you can't use input so I also create a second one without capture

When you are done press OK

Then create a new file Ctrl+N
Choose the schema "C/C++" (if you look at the top there is drop down that says "Plain Text" -- set that to C/C++) -- note you can skip this step, PN will set this when you save.
Type:
#include <iostream>

int main() {
    std::cout << "Hello World" << std::endl;
    return 0;
}


Save As -- remember to add a .cpp

Then press F5 to compile
Press F6 to run. (when you run it will give you a box for command line options just press enter or OK)



Hello to NickDMAX,

The above is a great little post; a gem! (Even nearly 2 years later)!

At least to a 'newbee' it is. I am so relieved to get this basic understanding of working with the command line, absolutely loved it. Reminds me of early DOS days.

I am a retiree and just started to 'play' with C_programming, and one of my frustrations was similar to the 'OP'.

I have to say the I think 3rd party IDE editors, while extremely convenient', are just like having a parent do all the work for their child; you learn nothing except how to select 'icons' in the menu bar. No fun what-so-ever! No challenge.

At least learning to work with the command line there is some sense of achievement. Off course, as a retiree I have a lot of time on my hands. So yes, for those who have to 'produce in a hurry' IDEs are probably the way to go.

Once again, thanks again NickDMAX for the generous use of your time and information.

Cheers!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1