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 +R\ 9F]R('-R86YD(&%N9"!R86YD#0HC:6YC
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<FEA8FQE<PT*"6EN="!N=6UB97([#0H):6YT(&=U97-S.PT*"6EN="!T<FEE
M<SL-" EI;G0 ;6EN3G5M8F5R.PT*"6EN="!M87A.=6UB97([#0H-" DO+R!I
M;FET:6%L:7IE(&5A8V  =F%R:6%B;&4 =&\ 82!N=6UB97( <V\ =&AA="!G
M87)B86=E#0H)+R\ :7, ;F]T('-T;W)E9"!I;B!V87)I86)L92X-" EM:6Y.
M=6UB97( /2`Q.PT*"6UA>$YU;6)E<B`](#$P,#L-" EN=6UB97( /2`P.PT*
M"6=U97-S(#T ,#L-" ET<FEE<R`](#`[#0H)#0H)<W)A;F0H*'5N<VEG;F5D
M*71I;64H3E5,3"DI.PT*"6YU;6)E<B`]("AR86YD*"D )2!M87A.=6UB97(I
M("L ;6EN3G5M8F5R.PT*#0H)8V]U="`\/"`B02!N=6UB97( :&%S(&)E96X 
M<&EC:V5D(&)E='=E96X (B`\/"!M:6Y.=6UB97( /#P (B!A;F0 (B`\/"!M
M87A.=6UB97( /#P (BXB(#P\(&5N9&P[#0H)9&\-" E[#0H)"71R:65S*RL[
M#0H)"6-O=70 /#P (D=U97-S(",B(#P\('1R:65S(#P\("(Z("([#0H)"6-I
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
M9W5E<W, /"!N=6UB97(I#0H)"0EC;W5T(#P\(")9;W5R(&=U97-S('=A<R!T
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 M0&5C:&\ ;V9F#0IE8VAO("X-"F5C:&\ 4V5T=&EN9R!U<"!C;VUM86YD(&QI M;F4 96YV:7)O;FUE;G0 9F]R($1I9VET86P 36%R<R!#+T,K*R X+C,P#0IE M8VAO("X-" T*<F5M($-O;7!I;&5R(&1R:79E#0II9B H)4-/35!?1%)6)2D M/3T *"D 9V]T;R!G;W1?;F]?8V]M<%]D<G8-"F=O=&\ 9V]T7V-O;7!?9')V M#0HZ9V]T7VYO7V-O;7!?9')V#0IS970 0T]-4%]$4E8]0SH-"CIG;W1?8V]M 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;W1?;F]?=V]R:U]D<G8-"G-E="!73U)+7T125CU#. T*.F=O=%]W;W)K7V1R M= T*#0IS970 0T]-4%]$25(])4-/35!?1%)6)5Q04D]'4D%-4UQ$35Q$33 S M,%Q$30T*<V5T($-/35!?0DE./25#3TU07T1)4B5<0DE.#0IS970 0T]-4%]) M3D,])4-/35!?1$E2)5QI;F-L=61E.R5#3TU07T1)4B5<:6YC;'5D95QW:6XS M,CLE0T]-4%]$25(E7'-T; T*<V5T($-/35!?3$E"/25#3TU07T1)4B5<;&EB M#0H-"G-E="!73U)+7T125CU(. T*<V5T(%=/4DM?1$E2/5Q$979<5&5S=%P- M" T*4$%42#TE0T]-4%]"24XE.R50051()3L-"G!A=& -"G-E="!)3D-,541% M/25#3TU07TE.0R4-"G-E="!,24(])4-/35!?3$E")0T*#0IE8VAO("X-"B57 J3U)+7T125B4-"F-D("573U)+7T1)4B4-"F5C:&\ + T*8VUD+F5X90T* ` end
Nov 21 2002