Go Back   Computer Forums > General Computing > Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 08-13-2006, 10:34 PM   #1
In Runtime
 
N_350Z's Avatar
 
Join Date: Jul 2006
Posts: 205
Default How can I set up the g++ compiler independently of Dev-C++?

After weeks I finally got a book on C++ and last night I was reading it and it stated that you could set up the g++ command line compiler if you had Dev-C++, but now I can't find it. And I figured that learning how to compile on the command line could be valuable before I start to get in too deeop. So could someone tell me how?
__________________

N_350Z is offline   Reply With Quote
Old 08-14-2006, 12:05 PM   #2
Baseband Member
 
Griz803's Avatar
 
Join Date: Jun 2004
Posts: 89
Default Re: How can I set up the g++ compiler independently of Dev-C++?

Quite frankly, I don't see why. But, if you have Dev-C++ it is already installed, just change directory to the executable under a command prompt and make the appropriate statement. You'll need to look up whatever switches are appropriate for your case, but generally "g++ -o myfile.exe myfile.c" will get it done. Which brings me to other things.
The Dev-C++ IDE has excellent facilities for doing the same thing without the muss and fuss. It is already set up so that typically, with the right selection of project type, your project(s) will compile and link flawlessly. I hope this quick run down helps, though IMHO, you're going backward rather than forward here.
__________________

__________________
/*What does not kill us, makes us drink far too much caffeine*/
Griz803 is offline   Reply With Quote
Old 08-15-2006, 04:53 AM   #3
Site Team
 
root's Avatar
 
Join Date: Mar 2004
Posts: 8,004
Default Re: How can I set up the g++ compiler independently of Dev-C++?

true... it is backwards rather than forwards...

but with a good knowledge of how the GCC compiler works from the command line then he only needs take the compiler and libraries with him, which, don't need to be installed in the same way that an IDE to interface with the tools does...

also he may find himself in front of a console in the future where there are no graphical tools only command line access. (such as ssh to a linux server).
__________________
I didn’t fight my way to the top of the food chain to be a vegetarian…
Im sick of people saying 'dont waste paper'. If trees wanted to live, they'd all carry guns.
"The inherent vice of capitalism is the unequal sharing of blessings; The inherent vice of socialism is the equal sharing of miseries."
root is offline   Reply With Quote
Old 08-18-2006, 12:24 PM   #4
Baseband Member
 
Griz803's Avatar
 
Join Date: Jun 2004
Posts: 89
Default Re: How can I set up the g++ compiler independently of Dev-C++?

Okay, root, I'm not saying it is a bad thing here to know the command line, but I will say these two things. First, if you are going to be doing any actual programming on Linux or *nix in general, yes, the command line is useful but editors and IDEs exist for *nix as well and are usually installed. Second, I merely meant that it is usually easier in the beggining to allow the facilities in a good IDE to do there job while you learn the language and the other nuances of programming than to worry about the proper switches to use with each type and variation of project. Perhaps others tend to teach in a different order. Please, don't take my comments as gospel or judgement, but only as expression of my surprise at something out of line with my experience, that's all.
__________________
/*What does not kill us, makes us drink far too much caffeine*/
Griz803 is offline   Reply With Quote
Old 08-20-2006, 03:38 PM   #5
In Runtime
 
N_350Z's Avatar
 
Join Date: Jul 2006
Posts: 205
Default Re: How can I set up the g++ compiler independently of Dev-C++?

I think it would be useful to know how to compile from the CL before I get too used to any IDE's. Knowing how to do that can't hurt in the long run.
N_350Z is offline   Reply With Quote
Old 08-20-2006, 05:57 PM   #6
Fully Optimized
 
UK31337's Avatar
 
Join Date: Feb 2005
Posts: 2,776
Default Re: How can I set up the g++ compiler independently of Dev-C++?

You can probably set up the compiler on the CLI (ie make it executable from anywhere), by adding something to your system environment variables.

You only need to ensure you've got the environment variable set up, and then you can run g++ <args> from anywhere on your system just by opening up Command Prompt. Providing you don't change the area in which you store the default libraries and headers etc., this should work just fine.
UK31337 is offline   Reply With Quote
Old 08-20-2006, 09:44 PM   #7
Daemon Poster
 
RewtGuy's Avatar
 
Join Date: Dec 2004
Posts: 595
Send a message via AIM to RewtGuy
Default Re: How can I set up the g++ compiler independently of Dev-C++?

learning how to compile from command line might not be as helpful as you think. learning the arguments and what a compiler can do might be what you're after. i don't think your ability to compile via commandline is going to have a dramatic effect on your coding ability.

http://gcc.gnu.org/

i think you learn the same amount of the langauge if you code in notepad (some other random text editor such as emacs, vi, or pico / nano) or an IDE such as dev-c++.
__________________
Windows: A thirty-two bit extension and GUI shell to a sixteen bit patch to an eight bit operating system originally coded for a four bit microprocessor and sold by a two-bit company that can't stand one bit of competition.
RewtGuy is offline   Reply With Quote
Old 08-20-2006, 09:52 PM   #8
In Runtime
 
N_350Z's Avatar
 
Join Date: Jul 2006
Posts: 205
Default Re: How can I set up the g++ compiler independently of Dev-C++?

Ahh okay. Thanks for the help guys.
__________________

N_350Z is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 01:59 AM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0