Http://wenku.baidu.com/link?url=xnjP6WXTPbpGBRvkAqCxeFQDSt3yN6H_ Yhm-lutjz6wm1mu9mujbfzkzoq09v5qzbnozesfynuhqwavkvabmd5ljxumz1hw0b7z8n5n7oow
Today I compiled a sendpkt.cpp source program, using the Linux compiler command. The use of the above document in a few sentences, really very simple, very useful oh.
GCC(GNU Compiler Collection) is the most important compilation tool under Linux,gcc Not only is the function very powerful, the structure is also exceptionally flexible.
It can support various languages through different front-end modules, such as Java,Fortran,Pascal,Modula-3 and Ada
g++ is A tool in GCC that specifically compiles the C + + language.
the parameters of GCC are:( also implemented in step )
-e allows GCC to stop compiling g++-e hello.cpp-o hello.i after preprocessing ends
-C compiles hello.i to target code g++-C hello.i-o hello.o
Connect the destination file to an executable file g++ hell.o-o Hello
Can be implemented in one step g++ hello.cpp-o Hello
Second, if there are more than two source files should be compiled.
One step to achieve g++ foo1.cpp foo2.cpp-o foo
You can also implement g++-C foo1.cpp-o foo1.o
g++-C Foo2.cpp-o foo2.o
g++ FOO1.O foo2.o-o foo
How to compile a C + + program under Linux