www.digitalmars.com         C & C++   DMDScript  

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

reply 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


begin 0644 number.cpp
M(VEN8VQU9&4 /&EO<W1R96%M+F ^("\O(&9O<B!C;W5T(&%N9"!C:6X-"B-I
M;F-L=61E(#QS=&1L:6(N:#X
M;'5D92`\=&EM92YH/B`O+R!T;R!U<V4 =&AE('1I;64 9G5N8W1I;VX-" T*
M=F]I9"!M86EN*"D-"GL-" DO+R!D96-L87)E(&%N9"!I;FET:6%L:7IE('9A


M;FET:6%L:7IE(&5A8V  =F%R:6%B;&4 =&\ 82!N=6UB97( <V\ =&AA="!G


M"6=U97-S(#T ,#L-
M*71I;64H3E5,3"DI.PT*"6YU;6)E<B`]("AR86YD*"D )2!M87A.=6UB97(I

M<&EC:V5D(&)E='=E96X (B`\/"!M:6Y.=6UB97( /#P (B!A;F0 (B`\/"!M
M87A.=6UB97( /#P (BXB(#P

M;B`^/B!G=65S<SL-" D):68 *&=U97-S(#X ;G5M8F5R*0T*"0D)8V]U="`\
M/"`B66]U<B!G=65S<R!W87, =&]O(&AI9V A(B`\/"!E;F1L.PT*"0EI9B`H

M;V\ ;&]W(2( /#P 96YD;#L-" E]('=H:6QE("AG=65S<R`A/2!N=6UB97(I
M.PT*"6-O=70 /#P (D-O;F=R871S+"!Y;W4 9W5E<W-E9"!T:&4 ;G5M8F5R
H(&EN("( /#P =')I97, /#P (B!T<FEE<R$B(#P\(&5N9&P[(`T*?75M
`
end
Nov 21 2002
parent "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
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
begin 666 dm830.cmd M/3T *"D 9V]T;R!G;W1?;F]?8V]M<%]D<G8-"F=O=&\ 9V]T7V-O;7!?9')V M<%]D<G8-" T*<F5M(%=O<FL 9')I=F4-"FEF(" E5T]22U]$4E8E*2 ]/2 H M*2!G;W1O(&=O=%]N;U]W;W)K7V1R= T*9V]T;R!G;W1?=V]R:U]D<G8-"CIG M" T*4$%42#TE0T]-4%]"24XE.R50051()3L-"G!A=& -"G-E="!)3D-,541% J3U)+7T125B4-"F-D("573U)+7T1)4B4-"F5C:&\ + T*8VUD+F5X90T* ` end
Nov 21 2002