News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

build vs compile?

Started by jinjin12, March 01, 2011, 08:03:15 PM

Previous topic - Next topic

jinjin12

what's the difference between building a .cpp file and compiling it? i'm curious because i see the options

MortenMacFly

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...).
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

jinjin12

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

MortenMacFly

Quote from: 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
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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]