how do i use borland C++ commpiler?

hey, i just downloaded borland C++ commpiler and i want to know how i start makeing my own programs with it. and how do i commpile them too.



Moses 1:39 - "For behold, this is my work and my glory-to bring to pass the immortality and eternal life of man.


-Troy


Comments

  • before you can start using the compiler you have to create some configuration files in the bin directory, there is a description of how to do this in the readme file, but ill tel you anyway...

    First open notepad and write the following:

    -I"c:program filescc55include"
    -L"c:program filescc55lib"

    The path must be the path to where you installed the compiler. Now save this file in the bin directory in the bcc5 directory, as bcc32.cfg, you might have to enclose the filename with two qoutes like this "bcc32.cfg" so you dont get a fileending like this bcc32.cfg.txt.
    When you done this you create a another file, and in this one you type this:

    -L"c:program filescc55lib

    and save this in the bin directory as ilink32.cfg.

    Why you have to do this is because these files tell the compiler where to search for the header and library files which is needed for you to compile most programs...

    Now a usefull but not really necessary thing to add the path to the compiler in your autexec.bat file, you do this by clicking on your start menu button, press run, and type sysedit, now select the window which is titled autoexec.bat, there type:

    SET PATH=C:program filescc55in

    And also here make sure you write the right path to the directory where you installed the compiler. If there already is a SET PATH to another program, I think you must put a semicolon after it and then write the path, for example if there is a line in the autoexec.bat file that looks something like this>

    SET PATH=C:anotherprogramin

    or whatever, you might have to edit it to this:

    SET PATH=C:anotherprogramin;C:program filescc55in

    anyway im not the greates guy on autexec scripting, so if you get into trouble just let me know.. And why is this usefull? well because you run the compiler from dos, and this line tells dos where to find the compiler program so that you dont have to type the whole path each time your going to compile a program... Also note that you have to reboot the computer before this change is made...

    Here you get some examples just to get starting:

    [code]
    #include

    int main(int argc, char**argv)
    {
    std::cout<<"Hello World!";

    std::cin.ignore(); // Don't exit the program until a key is hit
    return 0;
    }
    [/code]

    compile this example by going to wherever you save it in dos, and type:

    bcc32 helloworld.cpp

    This will compile the file and create a file called helloworld.exe, and it's ready to run.
    Heres another example, but how you can compile a windows app:

    [code]
    #include <windows.h>

    int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
    {
    MessageBox(NULL, "Hello World", "Message", MB_OK);
    return 0;
    }
    [/code]

    and you have to compile this one a bit different, like this:

    bcc32 -tW helloworld_win.cpp

    the -tW option tells the compiler that this is a windows app...


    : hey, i just downloaded borland C++ commpiler and i want to know how i start makeing my own programs with it. and how do i commpile them too.
    :
    :
    :
    : Moses 1:39 - "For behold, this is my work and my glory-to bring to pass the immortality and eternal life of man.
    :
    :
    : -Troy
    :
    :
    :

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion