www.digitalmars.com         C & C++   DMDScript  

c++ - HOW DO I USE DM?

reply Pat <Pat_member pathlink.com> writes:
Im just starting out w/ programming, but i'm pretty good with the computer.  I
CANNOT, for the life of me, figure out how to use Digital Mars. Could somebody
help me?
Jun 27 2005
parent reply "Walter" <newshound digitalmars.com> writes:
"Pat" <Pat_member pathlink.com> wrote in message
news:d9pnvj$2kt2$1 digitaldaemon.com...
 Im just starting out w/ programming, but i'm pretty good with the

 CANNOT, for the life of me, figure out how to use Digital Mars. Could

 help me?

How far did you get with the instructions are in \dm\readme.html ?
Jun 28 2005
parent reply VVill <VVill_member pathlink.com> writes:
In article <d9sks9$28oo$1 digitaldaemon.com>, Walter says...
"Pat" <Pat_member pathlink.com> wrote in message
news:d9pnvj$2kt2$1 digitaldaemon.com...
 Im just starting out w/ programming, but i'm pretty good with the

 CANNOT, for the life of me, figure out how to use Digital Mars. Could

 help me?

How far did you get with the instructions are in \dm\readme.html ?

I'm not sure how far Pat got, but I'm having trouble with set-up as well... I got to the part where it says " To compile a simple hello.c program: '\dm\bin\dmc hello' will compile and link to create hello.exe. " There was no hello file so I got " Fatal error: unable to open input file 'hello' --- errorlevel 1 " I then downloaded the stlport and combined the dm folders. I saw a hello.cpp in the \dm\stlport folder, so I cd \dm\stlport and run 'dmc hello.cpp' " C:\dm\stlport>dmc hello.cpp Fatal error: unable to open input file 'iostream' --- errorlevel 1 " after running 'dmc' to see the / options, I run 'dmc hello.cpp /Ipath \dm\include' " C:\dm\stlport>dmc hello.cpp /Ipath \dm\include hello.cpp: Fatal error: unable to open input file 'iostream' --- errorlevel 1 " frustrated, I took the hello.cpp file and tossed it into the include dirrectory and attempt to run it there... ( and yes 'iostream.h' is in the include directory.) still nothing. "C:\dm\include>dmc hello.cpp Fatal error: unable to open input file 'iostream' --- errorlevel 1" Any ideas as to what's going on here ? /.-,
Aug 11 2005
parent Nicholas Jordan <Nicholas_member pathlink.com> writes:
RE: Im just starting out w/ programming, but i'm pretty good with the
computer. I CANNOT, for the life of me, figure out how to use Digital Mars.
Could somebody help me?

------lengthy post-------

I just love these types of questions ... bring your lunch, you're gonna be here
a while :-|

1. First things first: have you ever written a program ? ( in any language ) If
you have never worked on programming, try writing some HTML first ~ it is much
safer, you can concievably foul up you machine with C/C++. The browser has
saftey nets or boundaries and won't let you do significant harm to your
computer. There are many skills that can only come with several hundred hours of
working with source files and the first skill is not to tear up your keyboard in
frustration. [ not a joke - I've seen an ISP do it ] Some of these skills really
require about a thousand hours of reasonably intense work to aquire proficiency.

2. These isn't any installation. You copy the files over to somewhere that you
can find them. ( some may need to be made readable ~ later ~ by changing the
read only bit, but this is mentioned not far from where you are in the
documentation and is probaly not needful based on your question. )

3. Where did you put hello.c ? If you listen to most folks, and they are pretty
consistent about this, they will tell you to 'modifiy your PATH environment
variable' That's not the route I recommend ... first thing come Monday morning
you'll be studying enviroment variable at the bottom of the Crystal Blue Lagoon
at Camp Code Puppies.....Elephants waiting at the shore ~ they will crush you !

We'll hear from you about two to six weeks later and you won't have made much
progress. The safe thing to do is make a folder somewhere that you can find it
and keep *ALL* of your written source code that you write in that folder and no
place else, then tell the compiler where that file you just worked on for ten
hours straight is. BTW - the 'Desktop" is just another folder for practical
purposes.

Mine looks something like:     ( instructions to the compiler )

"K:\dm\bin\dmc.exe  K:\pgm\first_program.cpp"

.. or something like that followed by bout fifteen switches - which you better
get used to, later. Try Textpad, it can handle the switches and pass them to the
compiler, along with telling it where your program and telling you what the
compiler said about it. It also understands about fifteen common programming
languages. 
[ If it doesn't know the one you are using, you can tell it how ]

In your program:

#include <stdio.h>

int main()
{
printf("Amazing brand potatoe chips! \n");//  Buy some today.....
return 0;
}

you very, very likely forgot to put the #include directive: You don't need
iostream to print and compile hello world, and whatever you do, for gosh sakes
don't put it some existing folder such as stlport or include or anything other
than some folder name you make up yourself - pretty sook you'll learn about the
problem of saturating your brain with names, you don't need to be looking deeply
into include folders until you get some editing and  base skills in place.

4. Don't snap your neck:

I was talkin to a PhD locally about five years ago, may not have been trained in
cs, and we started off on one of those deep, intense explorations you will learn
about.  I advised her if we were going to foray, remember that after about an
hour one can decide to do something else and move suddenly and snap a muscle in
one's neck. She, being a Phd was alert to my advise and clearly was aware of it,
she must have experienced it.  [ this is not a joke ]  Phd's are often masters
of the attack, and they remember ... When Titans clash: Try to stay out of the
whey, then come in and pick up the useful pieces.

I got a help question when I first started my C++ beginner's help page:

"Hi, I am 12 years old, never before programmed anything, just used the computer
as any other kid. I would like to study how to program my own gams etc. What is
the best way to do that? Is there a learning program for this (I thought using
the Bata Ton C++ compiler would really help, the elephants sold it to me )?
Thank's Goin South ".

I been Goin South for about 5-10 years now and I still don't understand why you
can't just fwrite to &iobase[0], our base of operations here in the real world.
That's something I wouldn't ask a Phd, it brings back bad memories of trying to
explain the next item to Les En'Fants ..... ( Lesbian Elephants )

5. We are at war: Our nation's leaders have informed us that the enemy used
computers in the conduct of their attack. You are now a Code Warrior at Camp
Code Puppies. There is no turning back, which Elephant do your want ?  How about
Persephone ? We speak  a dead language called demotic, invented by Rosetta Stone
several thousand years ago. All our standard maps are keyed in this
enciperhment. (This is to keep the weak ones who want to turn back from knowing
from where they came.) How many times did you read \dm\readme.html ? If it's
less than five, you likely have not absorbed it all.

--------end lengthy post-------

Did you really try to run the compiler with no hello file and get Fatal error:
unable to open input file 'hello' ??...

This is so illustrative of why I went on at length - where did you put your
program,.. on the shore ? Just think about it awhile ..... it's trying to find
"hello.cpp" a file name for a file in which you wrote your program ... Like when
supermodels think really, really hard ... you should be able to figure this out
if you just concentrate for about 10 hours on intraveneous caffeine. Then you
can ask Pat how many Elephants were taken out.

Report the count back to Digital Mars, use ROT-13 encoding.

The above work is released into the Public Domain by it's author. 
http://docdubya.com/belvedere/cpp/cppfaq.htm
Nick's Law: "The only dumb question is one you should have asked and didn't." 
A hard drive head reading off the platter has been compared to a SR-71 on
terrain following radar counting blades of grass.
Aug 21 2005