Howdy, Stranger!

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

Categories

How to compile C++ file from DOS

mransarimransari Member Posts: 1
Is there anyone who could pls tell me that how to compile a C++ file from MS DOS promt directly.

The complete command.

Thanks

Comments

  • MT2002MT2002 Member Posts: 1,444
    This is compiler dependent. What compiler?

  • Malcolm_McLeanMalcolm_McLean Member Posts: 254 ✭✭
    : Is there anyone who could pls tell me that how to compile a C++ file
    : from MS DOS promt directly.
    :
    : The complete command.
    :
    You call it as you would any other DOS shell program.

    That is to say, the name of the executable, any options, and the files you want it to operate upon.

    So the command will be something like

    msvc *.cpp

    (run compiler msvc on all files with the extension .cpp in this directory).

    However usually you'll want to pass quite a few options to a compiler. You might need to link in other libraries, define things to the proprocessor, set optimisation levels, etc. The commandlines can quickly become very complicated.

Sign In or Register to comment.