November 21, 2002 Compiling a Simple C++ Console Program - number.cpp | ||||
---|---|---|---|---|
| ||||
Attachments: | Hi all, I hope I'm posting in the right place. I'm having trouble creating the exe file for a guess the number console program. I created the file using Microsoft Visual C++, but for a school project, I need to learn how to compile the program using the free Digital Mars C/C++ console compiler. I've never used a console compiler for C++ before. I've attached a copy of the source code. The error I get is along the lines that iostream.h can not be found. I probably have the compiler files stored in the wrong directory or haven't specified the right options for the dmc.exe file. I unzipped all the files into C:\dm\bin\ and my source file is located in the same directory. In addition to iostream.h, I'm also needing to include stdlib.h and time.h. Thanks in advance for your help :) If possible, please send e-mail to MattTram@aol.com with response. Thanks, Matt |
November 21, 2002 Re: Compiling a Simple C++ Console Program - number.cpp | ||||
---|---|---|---|---|
| ||||
Posted in reply to MTram Attachments: | Simple. Just type dmc number.cpp In order for this to work, you'll need to have the following environment variables defined: INCLUDE LIB I'm including a command file (.cmd for NT/2000/XP, rename to .bat if you;re on 95/98/ME) that I use to set this all up for me. 1. If you have installed DMC++ to a drive other than C:, then you should define an environment variable for COMP_DRV, e.g. set COMP_DRV=G: 2. If you work on another drive than C:, then you should define an environment variable WORK_DRV, e.g. set WORK_DRV=H: 3. You should edit the definition of COMP_DIR to match your installation directory, eg. if you have installed to c:\dm, then change the line set COMP_DIR=%COMP_DRV%\PROGRAMS\DM\DM830\DM to set COMP_DIR=%COMP_DRV%\DM or simply to set COMP_DIR=C:\DM (in which case forget step 1 above) Once you have the include and lib environment variables set, you should be fine. Matthew "MTram" <MTram_member@pathlink.com> wrote in message news:arjb1p$16lt$1@digitaldaemon.com... > Hi all, I hope I'm posting in the right place. I'm having trouble creating the > exe file for a guess the number console program. I created the file using Microsoft Visual C++, but for a school project, I need to learn how to compile > the program using the free Digital Mars C/C++ console compiler. I've never used > a console compiler for C++ before. I've attached a copy of the source code. > The error I get is along the lines that iostream.h can not be found. I probably > have the compiler files stored in the wrong directory or haven't specified the > right options for the dmc.exe file. I unzipped all the files into C:\dm\bin\ > and my source file is located in the same directory. In addition to iostream.h, > I'm also needing to include stdlib.h and time.h. > Thanks in advance for your help :) If possible, please send e-mail to > MattTram@aol.com with response. > > Thanks, > Matt > > > |
Copyright © 1999-2021 by the D Language Foundation