www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript

c++.windows.32-bits - Compiling a Simple C++ Console Program - number.cpp

↑ ↓ ← MTram <MTram_member pathlink.com> writes:
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
Nov 21 2002
↑ ↓ → "Matthew Wilson" <dmd synesis.com.au> writes:
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

 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

 the program using the free Digital Mars C/C++ console compiler.  I've

 a console compiler for C++ before.  I've attached a copy of the source

 The error I get is along the lines that iostream.h can not be found.  I

 have the compiler files stored in the wrong directory or haven't specified

 right options for the dmc.exe file.  I unzipped all the files into

 and my source file is located in the same directory.  In addition to

 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

Nov 21 2002