GIDForums  

Go Back   GIDForums > Computer Programming Forums > C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 02-Nov-2005, 11:35
qmjhlpei qmjhlpei is offline
New Member
 
Join Date: Nov 2005
Posts: 6
qmjhlpei is on a distinguished road

Just learning C++,and already have a problem


Hey everyone,I decided I wanted to get into programming so I bought a book by Mike McGrath called C++ Programming in easy steps.As soon as I got started I ran into a problem.I did what the book said,and download MinGW-3.1.0-1.exe and installed it,then I am supposed to add the C:MinGW\bin subdirectory of the MinGW installation to my system path by going to Enviroment Variables,but It doesnt show any path variable that I can edit to add the \bin.

Please, can anyone help a newbie ...

Thanks for your time.
  #2  
Old 02-Nov-2005, 13:14
Gamer_2k4's Avatar
Gamer_2k4 Gamer_2k4 is offline
Member
 
Join Date: Apr 2005
Location: Wisconsin
Posts: 117
Gamer_2k4 will become famous soon enough

Re: Just learning C++,and already have a problem


If you're just learning c++, I'd suggest using Dev-C++. It's a very user-friendly compiler, it's free, and it's very easy to set up.
  #3  
Old 02-Nov-2005, 13:32
qmjhlpei qmjhlpei is offline
New Member
 
Join Date: Nov 2005
Posts: 6
qmjhlpei is on a distinguished road

Re: Just learning C++,and already have a problem


Thanks for the reply,I think I may have to resort to a different compiler.The only thing is,the entire book I'm learning from is based on MinGW
  #4  
Old 02-Nov-2005, 16:02
davekw7x davekw7x is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Left Coast, USA
Posts: 5,218
davekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to behold

Re: Just learning C++,and already have a problem


Quote:
Originally Posted by qmjhlpei

I am supposed to add the C:MinGW\bin subdirectory of the MinGW installation to my system path by going to Enviroment Variables,but It doesnt show any path variable that I can edit to add the \bin.


I think it's better to learn to use your system. Then if you don't like one compiler you can choose another. I don't think choices like this should be made simply because no one ever got you interested enough to make you want to learn.

Let's face it: you are starting something new (programming in C or C++). That's exciting, and you will have to learn lots of new stuff to get anything out of it. A very minor new thing to learn is how to set up a "PATH" environment variable on your system.

It's really not hard; it is easier to do than it is to describe in writing, but I'll give it a shot.

Each version of Windows has a different way of looking at environment variables. What are you using?

Right now I am on a Windows XP Pro system and here's how I set the environment variables:

First, open a "command prompt" window and enter

path

you should see some things that at least have

PATH=C:\WINDOWS\system32;C:\WINDOWS

(And, maybe, lots more stuff, depending on what applications have been installed and how they were installed.)

Now open up a Control Panel (System Settings -> Control Panel from the Start menu).

Click on the "System" icon, then the "Advanced" tab and the "Environment Variables" button.

You should see Two small windows. The upper is named "User variables for YourLoginName" and the lower is named "System variables"

The "User variables for YourLoginName" may have a couple of entries for "TEMP" and "TMP" (maybe more entries, maybe fewer)

If it already has PATH, then Highlight this entry and click "Edit". Go to the end of the existing path and enter a semicolon and then type in your new path information.

If it doesn't already have a PATH entry in the "User variables..." window, then do the following:
Click on the New button under the "User variables..." window and enter PATH for the variable name and put the path to Mingw in the "Variable value" line --- "C:\MingW\bin" (or whatever). Then click "OK" on all of the dialogue boxes that have been opened until finally the "System" box is closed.

Now if you don't see exactly what I see, you can use the "Help" thingie on your Start menu, and search for "Setting Environment "Variables".

Anyhow, now you should close the old command prompt window and open another one. (The changes you made will not be reflected in any command prompt windows that were already open.) Now if you enter PATH it should show the old path followed by a semicolon and then the new path stuff that you just entered.

Regards,

Dave
  #5  
Old 02-Nov-2005, 16:39
qmjhlpei qmjhlpei is offline
New Member
 
Join Date: Nov 2005
Posts: 6
qmjhlpei is on a distinguished road

Re: Just learning C++,and already have a problem


Dave,Thank you very much.You know your stuff,it worked.
  #6  
Old 02-Nov-2005, 16:41
Paramesh's Avatar
Paramesh Paramesh is offline
Regular Member
 
Join Date: Sep 2005
Location: The Milky Way
Posts: 929
Paramesh is a jewel in the roughParamesh is a jewel in the roughParamesh is a jewel in the rough

Re: Just learning C++,and already have a problem


Hi qmjhlpei,

There are two ways to use the mingw compiler.

Once is by the MS-DOS prompt and the other one is by using an IDE(Integrated development environment.)

Lets see how to use the command prompt to compile a C++ program.
(extracted from mingw documentation
Suppose we have a file hello.cpp and want to compile it. Then, use the following to compile and link:

g++ hello.cpp -o hello.exe

in the directory where you installed the compiler.

For example, if you have installed the compiler in C:MinGW\bin, then open the command prompt, and then go to the C:MinGW\bin directory. then save a file in the bin directory of name hello.cpp and then execute the above command line.

An IDE is a Graphical user interface that is overlapped on a compiler.
For example, Dev C++ is an IDE that uses the same MinGW compiler you use to compile using command line . The only thing is that it does all the work for you. Like: You can type in a C/C++ specific editor, then it is very easier to compile and run using an IDE.
Dont worry. Both the IDE and command prompt will give you the same errors because:
The IDE is not a compiler.
It uses another compiler in the background. We can set the IDE to work with any type of compiler.

I think the better way is to use an IDE.
It will do all the work for you.

Best Regards,
Paramesh.
__________________

Don't walk in front of me, I may not follow.
Don't walk behind me, I may not lead.
Just walk beside me and be my friend.
  #7  
Old 02-Nov-2005, 17:42
qmjhlpei qmjhlpei is offline
New Member
 
Join Date: Nov 2005
Posts: 6
qmjhlpei is on a distinguished road

Re: Just learning C++,and already have a problem


Quote:
Originally Posted by Paramesh
Hi qmjhlpei,

There are two ways to use the mingw compiler.

Once is by the MS-DOS prompt and the other one is by using an IDE(Integrated development environment.)

Lets see how to use the command prompt to compile a C++ program.
(extracted from mingw documentation
Suppose we have a file hello.cpp and want to compile it. Then, use the following to compile and link:

g++ hello.cpp -o hello.exe

in the directory where you installed the compiler.

For example, if you have installed the compiler in C:MinGW\bin, then open the command prompt, and then go to the C:MinGW\bin directory. then save a file in the bin directory of name hello.cpp and then execute the above command line.

An IDE is a Graphical user interface that is overlapped on a compiler.
For example, Dev C++ is an IDE that uses the same MinGW compiler you use to compile using command line . The only thing is that it does all the work for you. Like: You can type in a C/C++ specific editor, then it is very easier to compile and run using an IDE.
Dont worry. Both the IDE and command prompt will give you the same errors because:
The IDE is not a compiler.
It uses another compiler in the background. We can set the IDE to work with any type of compiler.

I think the better way is to use an IDE.
It will do all the work for you.

Best Regards,
Paramesh.

Thanks for the help.Ill take any help I can get right now,I just graduated high school and I love computers so I thought I would get into programming.I heard it is better to learn C before you learn C++,is that true?
  #8  
Old 02-Nov-2005, 19:21
Paramesh's Avatar
Paramesh Paramesh is offline
Regular Member
 
Join Date: Sep 2005
Location: The Milky Way
Posts: 929
Paramesh is a jewel in the roughParamesh is a jewel in the roughParamesh is a jewel in the rough

Re: Just learning C++,and already have a problem


Quote:
Originally Posted by qmjhlpei
Thanks for the help.Ill take any help I can get right now,I just graduated high school and I love computers so I thought I would get into programming.I heard it is better to learn C before you learn C++,is that true?
Extracted from alt.comp.lang.learn.c-c++:

According to a number of C++ experts, including its creator Bjarne
Stroustrup, and Marshall Cline (the author of the C++ FAQ), the
answer is a firm no.

Look up the C++ FAQ to see why Cline thinks you do not need to
learn C before C++. A post by Bjarne Stroustrup to comp.lang.c++
addresses this point too.
http://www.research.att.com/~bs/learn.html

"Learning Standard C++ as a New Language" - a paper by Stroustrup
available from http://www.research.att.com/~bs/papers.html -
examines this much-debated issue in great depth, but the paper is
aimed more at educators than at beginners.


But in my opinion, learning C before C++ does good!

Regards,
Paramesh.
__________________

Don't walk in front of me, I may not follow.
Don't walk behind me, I may not lead.
Just walk beside me and be my friend.
  #9  
Old 02-Nov-2005, 20:13
qmjhlpei qmjhlpei is offline
New Member
 
Join Date: Nov 2005
Posts: 6
qmjhlpei is on a distinguished road

Re: Just learning C++,and already have a problem


Are there any thing that I should learn that would help me in c++,because I'm just starting out.I consider myself smart in computers, but I have no education as I just graduated high school.Where did all you people start out and get into programming?
  #10  
Old 02-Nov-2005, 20:29
Paramesh's Avatar
Paramesh Paramesh is offline
Regular Member
 
Join Date: Sep 2005
Location: The Milky Way
Posts: 929
Paramesh is a jewel in the roughParamesh is a jewel in the roughParamesh is a jewel in the rough

Re: Just learning C++,and already have a problem


Quote:
Are there any thing that I should learn that would help me in c++,because I'm just starting out.I consider myself smart in computers, but I have no education as I just graduated high school.Where did all you people start out and get into programming?
A good C++ book will contain all the information you need to know.


I started with learning C language. Then my shift to C++ was very easy. The syntax and other things differ only slightly.

All the features of C are supported by C++.
C++ is a superset of C language.
So, in my opinion, learning C before C++ does good, though i respect other people's thoughts.

So, to start off, you should buy a good book.
The best book i recommend is
The C programming language by Kernighan and Ritchie.

They are the creators of the C programming language and i think is the best book to start with.

You could learn the basics in that book.

Then you could shift to a C++ book.
I recommend
C++ How to program by Deitel and Deitel.

Many would have different ideas but the things i mentioned here is only my opinions.

Best Regards,
Paramesh.
__________________

Don't walk in front of me, I may not follow.
Don't walk behind me, I may not lead.
Just walk beside me and be my friend.
 
 

Recent GIDBlogToyota - 2009 May Promotion by Nihal

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Graphic problem in Unreal Tournament 2004 zerox Computer Software Forum - Games 10 09-Oct-2005 13:31
Runtime Problem involving "printf" in C Program supamakia C Programming Language 2 09-Oct-2005 11:09
a significant problem after installing Xp mohammad Computer Software Forum - Windows 10 09-Aug-2005 08:03
String problem vaha C Programming Language 3 24-May-2005 19:21

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 01:11.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.