Google
 
Webcprogramming.com




An Affiliate of AIHorizon




g++

Released by the Free Software Foundation, g++ is a *nix-based C++ compiler usually operated via the command line. It often comes distributed with a *nix installation, so if you are running Unix or a Linux variant you likely have it on your system. You can invoke g++ on a source code file simply by typing
g++ filename


The default executable output of g++ is "a.out". It is also possible to specify a name for the executable file at the command line by using the syntax
-o outputfile
, as shown in the following example:
g++ filename -o outputfile

GDB Ready Code

If you want to prepare your executable for use by GDB, include the -g flag.
g++ filename -g -o outputfile
This will enable GDB to give you detailed debugging information by including extra code in the executable file to allow GDB to find variable names and list the source code.

Find Out More

If you are using a *nix system, you can also check out the other g++ commandline options by typing
man g++


-----
Interested in advertising with us?
Please read our privacy policy.
Copyright © 1997-2006 Cprogramming.com. All rights reserved.