User forums > Help

build vs compile?

(1/1)

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...).

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

--- End quote ---
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.

Navigation

[0] Message Index

Go to full version