Code::Blocks

User forums => Help => Topic started by: jinjin12 on March 01, 2011, 08:03:15 pm

Title: build vs compile?
Post by: jinjin12 on March 01, 2011, 08:03:15 pm
what's the difference between building a .cpp file and compiling it? i'm curious because i see the options
Title: Re: build vs compile?
Post by: MortenMacFly on March 01, 2011, 08:13:35 pm
Compile = Compiler compiles source code into an object file.
Build = Compiler compiles and linker links the object files created by the compiler into e.g. an executable application (or a library...).
Title: Re: build vs compile?
Post by: jinjin12 on March 02, 2011, 12:15:51 am
this is not related to code blocks but i'm curious, when i use the g++ -o on linux, does that build or compile?  i heard that it compiles into an object file, however, i am able to execute the resulting file, thus g++ -o actually builds(compile + link like you said) the file correct?  thanks for helping a noob btw
Title: Re: build vs compile?
Post by: MortenMacFly on March 02, 2011, 11:35:54 am
this is not related to code blocks but i'm curious, when i use the g++ -o on linux, does that build or compile?  i heard that it compiles into an object file, however, i am able to execute the resulting file, thus g++ -o actually builds(compile + link like you said) the file correct?  thanks for helping a noob btw
g++ -o builds (compile + link). The build will be an executable if the source code provides a main function accordingly.
g++ -c just compiles.

I am locking this topic now. For more basic stuff use Google / a programmers basic book / a compiler related forum.