www.digitalmars.com         C & C++   DMDScript  

c++ - Where Do I Write My Programs, Again? (reposted)

reply "Aurura" <aurura ev1.net> writes:
I had already posted this under a different topic, but I was concerned that it
might not get read by many ppl, since it was so far down the tree...  So I
reposted it as an independent.

Aurura
+++++++++++++++++++++++++++++++++

..it would seem that I don't even *have* hello.cpp  .  I did a Find in My
Computer, and it didn't find it anywhere.  Was this supposed to be there once I
unzipped DigiMars?

I'm a bit confused now-  Am I supposed to be writing programs in Notepad, or the
DigiMars compiler?  Which .exe file is the one I'm supposed to use to create
programs in the MSDOS prompt?

Up front, I really have appreciated everyone's kindness in response to my
inquiries.  Any further help is appreciated.

Thank You,

Me
Sep 16 2002
parent reply "Walter" <walter digitalmars.com> writes:
Try this:

#include <stdio.h>
int main()
{
    printf("hello world!\n");
}


"Aurura" <aurura ev1.net> wrote in message
news:am622v$hcn$1 digitaldaemon.com...
 I had already posted this under a different topic, but I was concerned

 might not get read by many ppl, since it was so far down the tree...  So I
 reposted it as an independent.

 Aurura
 +++++++++++++++++++++++++++++++++

 ..it would seem that I don't even *have* hello.cpp  .  I did a Find in My
 Computer, and it didn't find it anywhere.  Was this supposed to be there

 unzipped DigiMars?

 I'm a bit confused now-  Am I supposed to be writing programs in Notepad,

 DigiMars compiler?  Which .exe file is the one I'm supposed to use to

 programs in the MSDOS prompt?

 Up front, I really have appreciated everyone's kindness in response to my
 inquiries.  Any further help is appreciated.

 Thank You,

 Me

Sep 16 2002
parent reply "Aurura" <aurura ev1.net> writes:
...as "hello.cpp", but it saved it as "hello.cpp.txt".

I'm guessing that this is why, in the DOSprompt, I'm getting :

"Fatal error: unable to open input file 'hello' --- error level 1"

Is there anything else (free) out there beside Notepad that I can use to create
programs?

Also, I'm unsure as to where I should be saving the hello.cpp to; the dm, or bin
file?  Or, do I create a new folder in my DigiMars folder?

Each time I open the MSDOS Prompt, I have to type the following:

C:\cd program files\digmars\dm\bin\<whatever specific file>

Should I not have Digital Mars in my Program Files?  If not, where should it be?

Thanks,

Me
Sep 17 2002
parent reply bw <bw_member pathlink.com> writes:
geez, i'm sorry!  i guess in later versions of windows they have changed notepad
to always add the txt extension?  well you can rename it from the dos prompt
unless they have outlawed that too... a good text editor is hard to find you'll
just have to check out a few until you find something you like, try download.com
maybe.

maybe you can "subst s: c:\progra~1\digmars\dm\bin\" to get around that long cd
every time, that way you can just type s: and you are there, or a batch file can
save you some typing too.  if you're not really into the dosprompt thing it's
kinda confusing.. that's why IDDE programs are really great.  most of them
incorporate help too so when there's an error you can get an immediate reference
to figure out what the compiler's talking about.

hey congratulations on not being a weenie, lotta people would probably given up
by now, a dos box can really abuse ya sometimes!!

L8r,
bw

In article <am7mhk$2ctd$1 digitaldaemon.com>, Aurura says...
...as "hello.cpp", but it saved it as "hello.cpp.txt".

C:\cd program files\digmars\dm\bin\<whatever specific file>

Sep 17 2002
parent reply "Aurura" <aurura ev1.net> writes:
Thank you bw and Walter for your help and patience with me -- I finally got it
to work!

My question from this experience is:

When I look in my bin file now, I also see 'hello.obj' and 'hello.map'.  Were
these developed in order for hello.cpp to be linked with the kernel?  What do
these two extensions mean?

Very grateful for any help offered until I can afford a BOOK,

Me
Sep 17 2002
next sibling parent "Walter" <walter digitalmars.com> writes:
.obj files are generated by the compiler, .map files by the linker.

"Aurura" <aurura ev1.net> wrote in message
news:am84uq$2t3q$1 digitaldaemon.com...
 Thank you bw and Walter for your help and patience with me -- I finally

 to work!

 My question from this experience is:

 When I look in my bin file now, I also see 'hello.obj' and 'hello.map'.

 these developed in order for hello.cpp to be linked with the kernel?  What

 these two extensions mean?

 Very grateful for any help offered until I can afford a BOOK,

 Me

Sep 17 2002
prev sibling next sibling parent Chris <chris widdows.demon.nl> writes:
On Tue, 17 Sep 2002 16:03:50 -0500, "Aurura" <aurura ev1.net> wrote:

Thank you bw and Walter for your help and patience with me -- I finally got it
to work!

My question from this experience is:

When I look in my bin file now, I also see 'hello.obj' and 'hello.map'.  Were
these developed in order for hello.cpp to be linked with the kernel?  What do
these two extensions mean?

the obj is basically the output of the compiler for the .cpp or .c with the same name. Think of it as file containing your code translated into assembler and list specifying what the obj needs and what it offers. It is a binary file, but if you run it through Obj2Asm, you'll get the assembler code of the obj. The linker uses this to combine your obj's with others (lib files contains collection of obj's) to produce the .exe. To find out what went where the linker can produce a .map file, which is a text file detailing which routines came from where and the place in the .exe they ended up. Map files can be used to trace incorrect linkage (the linker choose another obj than the one you wanted) or even runtime errors. Regards, Chris
Very grateful for any help offered until I can afford a BOOK,

Me

Sep 17 2002
prev sibling parent reply Frank Albe <falbe mindspring.com> writes:
On Tue, 17 Sep 2002 16:03:50 -0500, "Aurura" <aurura ev1.net> wrote:

Thank you bw and Walter for your help and patience with me -- I finally got it
to work!

My question from this experience is:

When I look in my bin file now, I also see 'hello.obj' and 'hello.map'.  Were
these developed in order for hello.cpp to be linked with the kernel?  What do
these two extensions mean?

Very grateful for any help offered until I can afford a BOOK,

Me

One book that got pretty good reviews was Steve Heller's "Who's Afraid of C++" There's a web version here: http://www.steveheller.com/whos/index.htm It's written for a beginner. There is a free downloadable copy of Bruce Eckel's "Thinking in C++" at: http://www.mindview.net/Books You can get it in HTML or PDF. This one might rely too heavily on the "standard library" to be useful with DMC at the present time. ../frank
Sep 20 2002
parent "Aurura" <aurura ev1.net> writes:
I really appreciate the link.  I know I'll be needing it!

Right now, I'm studying the basics of C.  I'm at a pretty complicated chapter
right now (complicated mostly because I'm not that confident in my math skills).
I'm chugging away at it daily, tho.

Thanks, Again,

Me
Sep 20 2002